I'm having a big problem with getting the SSP running.
Basically I'm trying to right a simple set of routines for reading and
writing to the SSP that implement a simple TI SPI, and I'm stuck.
Here was my original idea for a simple write function:
while(SSPSR transmit fifo not empty) do nothing;
write data to SPDR;
This intermittently works, but occasionally drops characters. Over
the last few days I have tried to track the problem down, but with no
luck.
I have boiled down the problem to the following:
THIS WORKS:
POKE32( (unsigned long)(ssp_page + SSPDR), 0xF0 );
POKE32( (unsigned long)(ssp_page + SSPDR), 0x0F );
Two pieces of data come out.
THIS DOES NOT WORK:
PEEK32( (unsigned long)(ssp_page + SSPSR) );
POKE32( (unsigned long)(ssp_page + SSPDR), 0xF0 );
POKE32( (unsigned long)(ssp_page + SSPDR), 0x0F );
Only the one piece of data comes out.
Somehow reading the SSPSR is causing the fault, and without being able
to read that register I cannot reliably send data.
I have asked and received code samples from Technologic, but in all
their examples they don't read the SSPSR until after they sent the
data. They rely on the SPI always being empty, and since they don't
send large blocks of data this works for them.
I'm at a loss, does anyone have any insight to add?
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|