Serial Communication

Serial Peripheral Interface (SPI)

Serial Peripheral Interface (SPI) is an interface bus commonly used to send data between Microcontrollers and small peripherals such as shift registers, sensors, and SD cards.

It uses separate clock and data lines, along with a select line to choose the device you wish to talk to.

The SPI bus specifies 4 logic signals:

  • SCLK: Serial Clock (output from master)
  • MOSI: Master Out Slave In (data output from master)
  • MISO: Master In Slave Out (data output from slave) - CS /SS: Chip/Slave Select (often active low, output from master to indicate that data is being sent)

Note: There is no standard for naming, sometimes you will see these with other names

Multiple Slaves

How It Actually Works

At each clock transition, there is transmission of data. Register?

SPI vs. I2C?

I2C is half-duplex communication and SPI is full-duplex communication. So SPI is a lot faster.