SPI Bus Interface

The Serial Peripheral Interface (SPI) is a synchronous serial data link, developed by Motorola. SPI operates either in full-duplex or in half-duplex mode and can transfer data over short distances at high speeds.

During data transfer devices can work either in master or in slave mode. The source of synchronization is the system clock, which is generated by the master. The SPI interface allows to connect one or more slave devices to a single master device via the same bus.

SPI Interface

The SPI interface has four signal lines: MOSI, MISO, SCLK, and SS.

MOSI (Master Output, Slave Input)
MOSI line is used to transfer data from master to slave.
MISO (Master Input, Slave Output)
MISO line is used to transfer data from slave to master.
SCLK (Serial Clock)
SCLK clock pulse output from the master and clock pulse input for the slave. The SCLK line is used to synchronize data transfer between master and slave devices via MOSI and MISO lines.
SS (Slave Select)
The SPI master device uses this line to select the SPI slave. SS is an active low line.

The data is transferred bit by bit, starting with the high bit. The slave must be in high-impedance state if the slave is not selected through the SS line.

SPI Key Features

  • Read, write and full-duplex (simultaneous read/write) data transactions;

  • SPI master and SPI slave configuration;

  • Configurable SPI bus clock polarity, phase and frequency;

  • Configurable number of bits to transfer;

  • Communication with serial external devices (ADC and DAC, RTC, temperature and pressure sensors, LCD controller, etc.).

SPI Benefits

  • SPI is considered the fastest synchronous serial data transfer interface;

  • SPI is a very simple communication protocol;

  • Supports full-duplex communication;

SPI Drawbacks

  • Requires more traces on the board (X + 3, where X is the number of slave devices);

  • No hardware flow control;

  • No slave acknowledgment;

  • May prone to noise spikes causing faulty communication.