Author Topic: Simple SPI question  (Read 9513 times)

0 Members and 1 Guest are viewing this topic.

Offline SirNick

  • Frequent Contributor
  • **
  • Posts: 589
Re: Simple SPI question
« Reply #25 on: September 18, 2014, 07:40:09 pm »
Since no one mentioned this so far (afaics): The CS signal in SPI is not only used to select a slave. It is also used to determine the start of a transaction. ... So the leading edge of the CS pulse is also used to synchronize byte boundaries between master and slave.
Yes, this and one other crucial thing:

For SPI -- at least, with devices where communication is two-way -- you also need the CS pin to tell the receiving device to tri-state its transmitter.  Otherwise, the selected device's reply would be clobbered by all the other devices that are holding the MISO line in idle state.

For i2c, this isn't required, since it's an open-drain bus with a pull-up to keep the idle state.  Devices only pull the bus low to signal a bit when they have something to say, and arbitration and hold-off timers resolve conflicts.
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2881
  • Country: au
Re: Simple SPI question
« Reply #26 on: September 18, 2014, 09:38:56 pm »
Since no one mentioned this so far (afaics): The CS signal in SPI is not only used to select a slave. It is also used to determine the start of a transaction.

Actually, I mentioned it about 10 posts ago:   :)

Quote
The CS pin is still required to indicate the start and end of the data exchange though.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf