<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2>We have an AIC26&nbsp;<SPAN 
class=780381522-07062006>codec </SPAN>connected to our Lite5200B platform via 
J21.&nbsp; I've used MPC5200BUG to configure PSC3 as an SPI master, along with 
some samples I've found online&nbsp;<SPAN class=780381522-07062006>(including 
here) </SPAN>and&nbsp;<SPAN class=780381522-07062006>some I </SPAN>received from 
Freescale.&nbsp; Although the transfers seem to be working as expected (please 
see the&nbsp;<SPAN class=780381522-07062006>output file at the end of this 
message</SPAN>), I get only 0xffff back.&nbsp; This occurs whether or not the 
device is attached to J21.&nbsp; A scope shows that PSC3_8 (SPI_SS) and PSC3_9 
(SPI_CLK) are low at all times, and I'm concerned I'm still doing something 
wrong with respect to enabling SPI over PSC3.&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'm&nbsp;<SPAN class=780381522-07062006>including 
</SPAN>my driver initialization code, my write code, and output showing the 
write behavior.&nbsp; If someone could comment on it, I would greatly appreciate 
it.<SPAN class=780381522-07062006>.. or&nbsp;if someone flat out has code to do 
this, I'd be happy to take it from you.&nbsp; I've seen a few variations, but 
whether I use them directly or modify them as I&nbsp;need to, I can't seem to 
get past this.&nbsp; Of course, any other suggestions are 
welcome.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks.<BR>Sal</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>---------------------------------------------------------------------------<BR>Initialization 
Code<BR>---------------------------------------------------------------------------<BR>#define 
GPIO_PSC3_PORT_CONFIG_MASK 0x00000f00<BR>#ifdef SPI_USE_MCLK<BR>&nbsp;&nbsp; 
#define&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GPIO_PSC3_PORT_CONFIG 0x00000700&nbsp; /* 
PSC3 mode with mclk */<BR>#else&nbsp; /* SPI_USE_MCLK */<BR>&nbsp;&nbsp; 
#define&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GPIO_PSC3_PORT_CONFIG 0x00000600&nbsp; /* 
PSC3 mode */<BR>#endif /* SPI_USE_MCLK */</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#define&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
CDM_PSC3_MCLK_ENABLE 0x00000080<BR>#define&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
CDM_PSC3_MCLK_CONFIG 0x8020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Divide Fvco ftom 
528 to 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
16Mhz */</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#define&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
PSC3_SICR_REG_VALUE 0x0280f000&nbsp; /* 16-bit select Codec SPI 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
master mode, msb first, 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
UseEOF=1. GenClk=1, SIM, 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
CPOL and CPHA are 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
function input */&nbsp; 
<BR>...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp; /* Select the Pin-Muxing for PSC3 Codec mode */<BR>&nbsp;&nbsp; 
gpio = (struct mpc52xx_gpio *) ioremap(MPC52xx_GPIO,<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
sizeof(struct mpc52xx_gpio));<BR>&nbsp;&nbsp; if(gpio)<BR>&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; port_config = 
gpio-&gt;port_config;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; port_config &amp;= 
~GPIO_PSC3_PORT_CONFIG_MASK;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; port_config |= 
GPIO_PSC3_PORT_CONFIG;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gpio-&gt;port_config = 
port_config;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iounmap(gpio);<BR>&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp; else<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
return(-1);<BR>&nbsp;&nbsp; }</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#ifdef SPI_USE_MCLK<BR>&nbsp;&nbsp; /* PSC clock 
enable */<BR>&nbsp;&nbsp; g_pCDM-&gt;clk_enables |= 
CDM_PSC3_MCLK_ENABLE;<BR>&nbsp;&nbsp; g_pCDM-&gt;mclken_div_psc3 = 
CDM_PSC3_MCLK_CONFIG;<BR>#endif /* SPI_USE_MCLK */</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; /* Disable rx and tx 
*/<BR>&nbsp;&nbsp; g_pPSC-&gt;command = MPC52xx_PSC_RST_RX;<BR>&nbsp;&nbsp; 
g_pPSC-&gt;command = MPC52xx_PSC_RST_TX;<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_SEL_MODE_REG_1;<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_RST_ERR_STAT;<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_RX_DISABLE | MPC52xx_PSC_TX_DISABLE;&nbsp; </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; g_pPSC-&gt;mode = 0;<BR>&nbsp;&nbsp; 
g_pPSC-&gt;sicr = PSC3_SICR_REG_VALUE;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; #ifdef SPI_USE_MCLK<BR>&nbsp;&nbsp; 
g_pPSC-&gt;ccr=0x0703;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* set SCK and DSCKL 
delay */<BR>&nbsp;&nbsp; #else&nbsp; /* SPI_USE_MCLK */<BR>&nbsp;&nbsp; 
g_pPSC-&gt;ccr=0x0003;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* set SCK and DSCKL 
delay must be &gt; 2 */<BR>&nbsp;&nbsp; #endif /* SPI_USE_MCLK */</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; 
g_pPSC-&gt;ctur=0x00;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Set DTL delay 
2us */<BR>&nbsp;&nbsp; g_pPSC-&gt;ctlr=0x84;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; 
g_pPSC-&gt;rfalarm=100;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Alarm values taken from 
SPI example sample */<BR>&nbsp;&nbsp; g_pPSC-&gt;tfalarm=1;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; g_pPSC-&gt;rfcntl &amp;= 
0xf8;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* 0 byte granularity 
*/<BR>&nbsp;&nbsp; g_pPSC-&gt;tfcntl = 1;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; /* Enable rx &amp; tx 
*/<BR>&nbsp;&nbsp; g_pPSC-&gt;command = MPC52xx_PSC_RST_RX;<BR>&nbsp;&nbsp; 
g_pPSC-&gt;command = MPC52xx_PSC_RST_TX;<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_SEL_MODE_REG_1;<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_RST_ERR_STAT;<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_RX_ENABLE | MPC52xx_PSC_TX_ENABLE;&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>---------------------------------------------------------------------------<BR>Write 
code<BR>---------------------------------------------------------------------------<BR>static 
int mpc52xx_spi_transfer(u16 *p_usBuffer, u16 p_usCount)<BR>{<BR>&nbsp;&nbsp; 
u16 usIndex, usTemp;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; 
printk("------------------------------------------------------\n");<BR>&nbsp;&nbsp; 
printk("Entry:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=%x 
status=%04x tfstat=%04x rfstat=%04x mode=%02x\n&nbsp;&nbsp; tfnum %3d&nbsp; 
rfnum %3d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
(int)g_pPSC,g_pPSC-&gt;mpc52xx_psc_status,g_pPSC-&gt;tfstat,g_pPSC-&gt;tfstat,g_pPSC-&gt;mode,<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;tfnum, g_pPSC-&gt;rfnum);<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_RST_RX;<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_RST_TX;<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_SEL_MODE_REG_1;<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_RST_ERR_STAT;<BR>&nbsp;&nbsp; g_pPSC-&gt;command = 
MPC52xx_PSC_RX_ENABLE | MPC52xx_PSC_TX_ENABLE;<BR>&nbsp;&nbsp; printk("TX-RX 
Enable:&nbsp; psc=%x status=%04x tfstat=%04x rfstat=%04x mode=%02x\n&nbsp;&nbsp; 
tfnum %3d&nbsp; rfnum %3d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
(int)g_pPSC,g_pPSC-&gt;mpc52xx_psc_status,g_pPSC-&gt;tfstat,g_pPSC-&gt;tfstat,g_pPSC-&gt;mode,<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;tfnum, g_pPSC-&gt;rfnum);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; /* Clean out the read FIFO 
*/<BR>&nbsp;&nbsp; usIndex = 0;<BR>&nbsp;&nbsp; 
while(g_pPSC-&gt;mpc52xx_psc_status &amp; MPC52xx_PSC_SR_RXRDY)<BR>&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; usTemp = 
g_pPSC-&gt;mpc52xx_psc_buffer_16;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
printk("Flushing Rx FIFO: psc=%x status=%04x tfstat=%04x rfstat=%04x 
mode=%02x\n&nbsp;&nbsp; tfnum %3d&nbsp; rfnum 
%3d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(int)g_pPSC,g_pPSC-&gt;mpc52xx_psc_status,g_pPSC-&gt;tfstat,g_pPSC-&gt;tfstat,g_pPSC-&gt;mode,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;tfnum, g_pPSC-&gt;rfnum);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
usIndex++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(usIndex == 10) 
return(-1);<BR>&nbsp;&nbsp; }</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; /* Send out the buffer 
*/<BR>&nbsp;&nbsp; g_pPSC-&gt;command = MPC52xx_PSC_RX_ENABLE | 
MPC52xx_PSC_TX_DISABLE;<BR>&nbsp;&nbsp; for(usIndex=0; usIndex&lt;p_usCount; 
usIndex++)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printk("Sending 
%04x:&nbsp; psc=%x status=%04x tfstat=%04x rfstat=%04x mode=%02x\n&nbsp;&nbsp; 
tfnum %3d&nbsp; rfnum %3d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
p_usBuffer[usIndex], 
(int)g_pPSC,g_pPSC-&gt;mpc52xx_psc_status,g_pPSC-&gt;tfstat,g_pPSC-&gt;tfstat,g_pPSC-&gt;mode,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;tfnum, g_pPSC-&gt;rfnum);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;mpc52xx_psc_buffer_16 = 
p_usBuffer[usIndex];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
printk("Sent:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=%x 
status=%04x tfstat=%04x rfstat=%04x mode=%02x\n&nbsp;&nbsp; tfnum %3d&nbsp; 
rfnum %3d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(int)g_pPSC,g_pPSC-&gt;mpc52xx_psc_status,g_pPSC-&gt;tfstat,g_pPSC-&gt;tfstat,g_pPSC-&gt;mode,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;tfnum, g_pPSC-&gt;rfnum);<BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp; 
g_pPSC-&gt;command = MPC52xx_PSC_RX_ENABLE | 
MPC52xx_PSC_TX_ENABLE;<BR>&nbsp;&nbsp; usTemp = 0;<BR>&nbsp;&nbsp; 
while(g_pPSC-&gt;tfnum)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
printk("TFNUM Wait:&nbsp;&nbsp; psc=%x status=%04x tfstat=%04x rfstat=%04x 
mode=%02x\n&nbsp;&nbsp; tfnum %3d&nbsp; rfnum 
%3d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(int)g_pPSC,g_pPSC-&gt;mpc52xx_psc_status,g_pPSC-&gt;tfstat,g_pPSC-&gt;tfstat,g_pPSC-&gt;mode,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;tfnum, g_pPSC-&gt;rfnum);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
usTemp++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(usTemp == 10) 
return(-1);<BR>&nbsp;&nbsp; };<BR>&nbsp;&nbsp; 
printk("TxRDY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=%x 
status=%04x tfstat=%04x rfstat=%04x mode=%02x\n&nbsp;&nbsp; tfnum %3d&nbsp; 
rfnum %3d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
(int)g_pPSC,g_pPSC-&gt;mpc52xx_psc_status,g_pPSC-&gt;tfstat,g_pPSC-&gt;tfstat,g_pPSC-&gt;mode,<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;tfnum, g_pPSC-&gt;rfnum);<BR>&nbsp;&nbsp; for(usIndex=0; 
usIndex&lt;p_usCount; usIndex++)<BR>&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; usTemp = 
0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(!(g_pPSC-&gt;mpc52xx_psc_status &amp; 
MPC52xx_PSC_SR_RXRDY))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printk("RxRDY 
Wait:&nbsp;&nbsp;&nbsp; psc=%x status=%04x tfstat=%04x rfstat=%04x 
mode=%02x\n&nbsp;&nbsp; tfnum %3d&nbsp; rfnum 
%3d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(int)g_pPSC,g_pPSC-&gt;mpc52xx_psc_status,g_pPSC-&gt;tfstat,g_pPSC-&gt;tfstat,g_pPSC-&gt;mode,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;tfnum, 
g_pPSC-&gt;rfnum);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
udelay(100000);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
usTemp++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(usTemp == 10) 
return(-1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
printk("RxRDY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=%x 
status=%04x tfstat=%04x rfstat=%04x mode=%02x\n&nbsp;&nbsp; tfnum %3d&nbsp; 
rfnum %3d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(int)g_pPSC,g_pPSC-&gt;mpc52xx_psc_status,g_pPSC-&gt;tfstat,g_pPSC-&gt;tfstat,g_pPSC-&gt;mode,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;tfnum, g_pPSC-&gt;rfnum);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
p_usBuffer[usIndex] = 
g_pPSC-&gt;mpc52xx_psc_buffer_16;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
printk("&nbsp; Received %04x\n", p_usBuffer[usIndex]);<BR>&nbsp;&nbsp; 
}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; 
printk("EXIT:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=%x 
status=%04x tfstat=%04x rfstat=%04x mode=%02x\n&nbsp;&nbsp; tfnum %3d&nbsp; 
rfnum %3d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
(int)g_pPSC,g_pPSC-&gt;mpc52xx_psc_status,g_pPSC-&gt;tfstat,g_pPSC-&gt;tfstat,g_pPSC-&gt;mode,<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
g_pPSC-&gt;tfnum, g_pPSC-&gt;rfnum);<BR>&nbsp;&nbsp; 
return(usIndex);<BR>}</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR>---------------------------------------------------------------------------<BR>Output<BR>---------------------------------------------------------------------------<BR>The 
lines below are a capture of register settings from my driver,<BR>along with 
output lines when trying to write 16 bit words to our<BR>device.&nbsp; This 
output is consistent whether the device is connected<BR>or not (via J21).&nbsp; 
Basic operation, delimited by "------...---":</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; - Disable TX, Enable RX (despite the "TX-RX Enable" 
heading)<BR>&nbsp; - Send word 1<BR>&nbsp; - Send word 2<BR>&nbsp; - Enable TX, 
Enable RX<BR>&nbsp; - Wait for tfnum == 0<BR>&nbsp; - Receive 
data<BR>&nbsp;<BR>port_config=91051624 sicr=0280f000 clk_enables=00ffffff 
div_psc3=800f<BR>------------------------------------------------------<BR>Entry:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
psc=f0002400 status=0400 tfstat=0003 rfstat=0003 mode=33<BR>&nbsp;&nbsp; 
tfnum&nbsp;&nbsp; 0&nbsp; rfnum&nbsp;&nbsp; 0<BR>TX-RX Enable:&nbsp; 
psc=f0002400 status=0400 tfstat=0003 rfstat=0003 mode=33<BR>&nbsp;&nbsp; 
tfnum&nbsp;&nbsp; 0&nbsp; rfnum&nbsp;&nbsp; 0<BR>Sending 0880:&nbsp; 
psc=f0002400 status=0400 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; 
tfnum&nbsp;&nbsp; 0&nbsp; rfnum&nbsp;&nbsp; 
0<BR>Sent:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=f0002400 
status=0000 tfstat=0002 rfstat=0002 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 
2&nbsp; rfnum&nbsp;&nbsp; 0<BR>Sending bb00:&nbsp; psc=f0002400 status=0000 
tfstat=0002 rfstat=0002 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 2&nbsp; 
rfnum&nbsp;&nbsp; 
0<BR>Sent:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=f0002400 
status=0000 tfstat=0002 rfstat=0002 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 
4&nbsp; rfnum&nbsp;&nbsp; 0<BR>TFNUM Wait:&nbsp;&nbsp; psc=f0002400 status=0000 
tfstat=0002 rfstat=0002 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 2&nbsp; 
rfnum&nbsp;&nbsp; 0<BR>TxRDY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
psc=f0002400 status=0500 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; 
tfnum&nbsp;&nbsp; 0&nbsp; rfnum&nbsp;&nbsp; 
4<BR>RxRDY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=f0002400 
status=0500 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 
0&nbsp; rfnum&nbsp;&nbsp; 4<BR>&nbsp; Received 
ffff<BR>RxRDY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=f0002400 
status=0500 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 
0&nbsp; rfnum&nbsp;&nbsp; 2<BR>&nbsp; Received 
ffff<BR>EXIT:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=f0002400 
status=0400 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 
0&nbsp; rfnum&nbsp;&nbsp; 
0<BR>------------------------------------------------------<BR>Entry:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
psc=f0002400 status=0400 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; 
tfnum&nbsp;&nbsp; 0&nbsp; rfnum&nbsp;&nbsp; 0<BR>TX-RX Enable:&nbsp; 
psc=f0002400 status=0400 tfstat=0003 rfstat=0003 mode=33<BR>&nbsp;&nbsp; 
tfnum&nbsp;&nbsp; 0&nbsp; rfnum&nbsp;&nbsp; 0<BR>Sending 8820:&nbsp; 
psc=f0002400 status=0400 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; 
tfnum&nbsp;&nbsp; 0&nbsp; rfnum&nbsp;&nbsp; 
0<BR>Sent:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=f0002400 
status=0000 tfstat=0002 rfstat=0002 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 
2&nbsp; rfnum&nbsp;&nbsp; 0<BR>Sending 0000:&nbsp; psc=f0002400 status=0000 
tfstat=0002 rfstat=0002 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 2&nbsp; 
rfnum&nbsp;&nbsp; 
0<BR>Sent:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=f0002400 
status=0000 tfstat=0002 rfstat=0002 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 
4&nbsp; rfnum&nbsp;&nbsp; 0<BR>TFNUM Wait:&nbsp;&nbsp; psc=f0002400 status=0000 
tfstat=0002 rfstat=0002 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 2&nbsp; 
rfnum&nbsp;&nbsp; 0<BR>TxRDY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
psc=f0002400 status=0500 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; 
tfnum&nbsp;&nbsp; 0&nbsp; rfnum&nbsp;&nbsp; 
4<BR>RxRDY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=f0002400 
status=0500 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 
0&nbsp; rfnum&nbsp;&nbsp; 4<BR>&nbsp; Received 
ffff<BR>RxRDY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=f0002400 
status=0500 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 
0&nbsp; rfnum&nbsp;&nbsp; 2<BR>&nbsp; Received 
ffff<BR>EXIT:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psc=f0002400 
status=0400 tfstat=0003 rfstat=0003 mode=07<BR>&nbsp;&nbsp; tfnum&nbsp;&nbsp; 
0&nbsp; rfnum&nbsp;&nbsp; 0</FONT></DIV></BODY></HTML>