IntermediateTopic 65 of 104Electronics & Embedded

SPI

Fast synchronous serial bus with master, slave and chip select.

In depth

SPI is a synchronous full-duplex bus with SCLK, MOSI, MISO and chip-select per device. Clock polarity and phase give four modes. Speeds of tens of MHz; no addressing so more pins for multiple slaves. Used for flash, displays and ADCs.

Key points

  • Master-slave
  • Daisy chaining
  • Higher speed than I²C
Example

An SD card in SPI mode reads at several MB/s.

Why it matters

SPI is fast and simple for connecting sensors, memories and displays on a short board-level link.

Where this is used

  • Reading an SD card or flash memory with a fast clock.
  • Connecting a display controller to a microcontroller.
  • Reading a high-speed ADC that streams data after each conversion.

Frequently asked questions

What is SPI?

Fast synchronous serial bus with master, slave and chip select.

Why is it important to understand SPI?

SPI is fast and simple for connecting sensors, memories and displays on a short board-level link.

How many wires does SPI need?

Typically four: clock, master out slave in, master in slave out and chip select, with one chip select for each slave.

What is a disadvantage of SPI?

It needs a separate chip select line for each device and has no built-in addressing, so many devices use many pins.

How is SPI used in practice?

Typical applications include reading an SD card or flash memory with a fast clock, connecting a display controller to a microcontroller and reading a high-speed ADC that streams data after each conversion.

What should I learn before SPI?

Study "UART" first (topic 64 of 104 in Electronics & Embedded). It covers the groundwork this topic builds on.

What are the key points of SPI?

Master-slave. Daisy chaining. Higher speed than I²C.

Can you give an example of SPI?

An SD card in SPI mode reads at several MB/s.

What comes after SPI?

The next topic is "I2C", which builds directly on this one.

How difficult is SPI?

It is classed as Intermediate in Electronics & Embedded (topic 65 of 104). It is an intermediate topic. Work through the beginner topics in Electronics & Embedded first.

Learning path

Want to practise? Open the interactive course for quick checks, quizzes, simulations and progress tracking.