

But SPI bus can be used in different configurations like a single master and a single slave as shown in the diagram below. SPI Working OperationĪs we mentioned earlier, the SPI bus consists of a single master and multiple slave devices. Every master device sends data on the MOSI line and receives data through another line that is MISO. Whenever a master device read to transmit data to slave or want to receive data from the slave, the master does so by activating the clock signal. Chip select line is usually used to identify or select a particular slave device. The master device also selects the slave device to which data need to be transferred. The master device is mainly responsible for the initiation of the data frame. In short, in this communication protocol, devices exchange data in master/slave mode.

This line is used to send data from the slave to the Master. MISO: This is known as Master input and a Slave output.As its name suggests, this line used to send data from master to slave. This stands for Master output and Slave input pin. This line selects the slave to which Master want to transfer data. SS or CS : This is known as a chip select or Slave select pin.inactive or tri-state when no operation is carried out. Note that this pin remains in idle state.

SCLK or SCK pin : This signal provides a clock to Slaves and only Master can control clock signal.The functionality of each signal is given here. But in this article, We will see a general 4 wire interface. SPI interface consists of either three or four signals. The Block diagram below shows interfacing with one Master and one Slave. Both Master and Slave can exchange data with each other on the rising and falling edge of the clock signal. It is Full duplex synchronous communication. Both master and slave can exchange data with each other.Data can not be transferred without a clock signal.The only master device can control the clock and provide a clock signal to all slave devices.The clock signal controls when data is to be sent to the slave and when it should be ready to read.

Unlike UART communication which is asynchronous.The synchronous interface means it requires a clock signal to transfer and receive data and the clock signal is synchronized between both master and slave. It is a serial and synchronous interface.Different Configuration Modes of SPI Bus.
