View previous topic :: View next topic |
Author |
Message |
boulder
Joined: 15 Mar 2008 Posts: 53
|
SPI Protocol Questions |
Posted: Fri Dec 12, 2008 11:57 pm |
|
|
Hi,
I am using a PIC chip as a slave to communication with a master chip through SPI interface. And I have questions about SPI protocol. Can SPI slave send out a packet with multiple bytes to master after receiving one byte command? Or does SPI slave have to send out only one byte data to master after receive one byte command? If master write one byte data to slave, does slave have to send one byte back? How long can SPI clock last after master send one byte?
I know usually SPI interface communication is one byte send and one byte receive. Since timing is extremely important to my project, I don't want to waste time on too much transmit and receive.
Thanks!!!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sat Dec 13, 2008 4:51 am |
|
|
As an additional remark: Slave select (SS), that acts as frame sync, also helps in identifying the byte position in multiple byte transmission. Usually, the master asserts SS before transmission start (active low is the original Motorola standard, but may be also active high), send and receives multiple bytes and deasserts it. The slave software must be fast enough to pick the received data after each interrupt and supply the send data.
If you connect hardware SPI slaves, e.g. ADC chips or SPI memory, they have a fixed multiple byte frame organisation, that must be exactly met by the master. |
|
|
|