cancel
Showing results for 
Search instead for 
Did you mean: 

SPI interfacing questions

davidfussell9
Associate II
Posted on June 19, 2008 at 10:51

SPI interfacing questions

1 REPLY 1
davidfussell9
Associate II
Posted on May 17, 2011 at 09:53

Hi,

I'm interfacing an ST accelerometer (LIS302DL) as a slave to an STR9 'master' device, using the SPI interface and am suprised at the apparent difficulty-

I assume that I have to use the Motorola SPI frame format, as only this permits the necessary clock polarity/phase settings for the slave, so in order to read an 8 bit value from the slave, I need (I think) to set the SSP's data size to 16 bits, left-shift my slave address byte into the MSB of the command word, write this to the SSP's Tx fifo, reading the Rx fifo when the transmission is complete, since, at this time the slave will have placed its data out during the master's clocking in of the (unused) LSB of the command word. Does this sound right?

Also, is there a means to clear the SSP Tx and Rx fifo's (without reading from them until SSP_SR indicates they're empty)?

And finally, am I right in thinking that I can't make use of the LIS302DL's handy 'autoincrementing' addressing feature, due to 16 bit limitation of the command word, so everything has to be written/read one byte at a time?

Seems a little 'bit-blasting' solution might actually be easier to implement, and more efficient...

Thanks for any recommendations/suggestions

Dave