SPI
A fast four-wire synchronous bus: SCLK, MOSI, MISO and a chip-select per device.
Easy
The controller drives the clock and selects a device by pulling its CS (chip select) low. Data shifts out on MOSI (now often called COPI/SDO) and in on MISO (CIPO/SDI) simultaneously — full duplex.
SPI modes (clock polarity CPOL and phase CPHA):
| Mode | CPOL | CPHA | Clock idles | Sample on |
|---|---|---|---|---|
| 0 | 0 | 0 | low | rising edge |
| 1 | 0 | 1 | low | falling edge |
| 2 | 1 | 0 | high | falling edge |
| 3 | 1 | 1 | high | rising edge |
Check the datasheet for the device's mode. SPI is used for SD cards, displays, flash memory and fast ADCs.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.