19.2.2 SPI Bus Connection

In Figure 19-1, the connection between one master and one slave is shown.

Figure 19-1. SPI Bus Connection
The different lines are as follows:
  • MISO Master Input Slave Output. The line where the data is shifted out from the slave and into the master.

  • MOSI Master Output Slave Input. The line where the data is shifted out from the master and into the slave.

  • SCK Serial Clock. Generated by the master device.

  • SS Slave Select. To initiate a transaction, the master must pull this line low.

If the bus consists of several SPI slaves, they can be connected in parallel and the SPI master can use general I/O pins to control separate SS lines to each slave on the bus.

It is also possible to connect all slaves in series. In this configuration, a common SS is provided to N slaves, enabling them simultaneously. The MISO from the N-1 slaves is connected to the MOSI on the next slave. The Nth slave connects its MISO back to the master. For a complete transaction, the master must shift N+1 characters.