Hi all,

Well I was right, I did end up embarrassing myself.  As Andrei pointed out,  I was writing to the interrupt test register,  not the FIFO!  oops.




From: gumstix-users-bounces@lists.sourceforge.net [mailto:gumstix-users- bounces@lists.sourceforge.net] On Behalf Of chuck kamas
Sent: Friday, March 16, 2007 10:18 PM
To: gumstix
Subject: [Gumstix-users] Spi woes

Hi all,

time to embarrass myself, but I am getting pretty frustrated with ye old spi. I am hoping that you all can say where I am missing the obvious. I have made my own polled SPI driver (I know I should use the examples!) but SPI is so easy (right!).

My driver does the following:

1) sets up the gpio pins as AF1, or AF2 depending on their purpose.
gpio_function (SPI_CLCK, AF1); // spi clk
gpio_direction (SPI_CLCK, OUT); // spi clk is an output

gpio_function (SPI_FRAM, AF1); // spi frame
gpio_direction (SPI_FRAM, OUT); // spi frame is an output

gpio_function (SPI_MOSI, AF1); // spi MOSI
gpio_direction (SPI_MOSI, OUT); // spi MOSI is an output

gpio_function (SPI_MISO, AF2); // spi MISO
gpio_direction (SPI_MISO, IN); // spi MISO is an input
2) sets up the SPI registers SSCR1 and SSCR0
putmem (SSCR1,1<<30);
putmem (SSCR0,0xfff << 8 | 1<< 7 | 7<<0);
3) I then write to the SSITR.
putmem(SSITR,txb); // Set the Tx Value

If my understanding is correct, this should cause the SCLK and MOSI pins to wiggle... But alas, nothing happens.

I must be missing the obvious... but I just can not see it!



Don't get soaked. Take a quick peek at the forecast
with theYahoo! Search weather shortcut.