Search code examples
spi

Are all zeros valid SPI read/write data?


If yes, how does the hardware know if there's really data or not since the level on the MOSI/MISO line never changes.


Solution

  • I assume that with SPI you mean Serial Peripheral Interface.

    According to wikipedia, the data is sent like this:

    During each SPI clock cycle, a full duplex data transmission occurs. The master sends a bit on the MOSI line and the slave reads it, while the slave sends a bit on the MISO line and the master reads it. This sequence is maintained even when only one-directional data transfer is intended.

    (https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Data_transmission).

    Because it works with a clock, sending (only) zeros should work.


    Besides that, with something like the Manchester code, the MOSI/MISO line would change. I'm not sure if this can be used with the Serial Peripheral Interface though.