Level 3 · Protocol Reference

SPI

No addresses, no acknowledgments. Just a select line, a clock, and two data lines moving in both directions at exactly the same time. Simple wiring, real speed.

WiresSCK + MOSI + MISO + CS + GND
ClockShared, driven by the controller
TopologyShared bus, one CS wire per device
Typical speed1 – 50+ MHz

A Little History

SPI, short for Serial Peripheral Interface, came out of Motorola in the 1980s, alongside their 68000-series microcontrollers. Unlike I²C, it was never formally standardized by any committee; it just became the de facto convention because it was simple to implement in hardware and fast enough to matter. That informal history is exactly why SPI has quirks like four numbered "modes" rather than one fixed behavior, because different manufacturers settled on slightly different conventions before anyone was enforcing one.

What It's Actually For

Fast, short-distance, chip-to-chip communication where wire count is cheap but speed matters, such as flash memory, SD cards, ADCs/DACs and small displays. Where I²C trades speed for wire count, SPI makes the opposite bet: more wires (four instead of two), but no addressing overhead and a clock rate that can run into the tens of MHz.

The clock and data lines are shared by every device on the bus, but there are no addresses, so each device also needs its own CS line: a dedicated select wire from the controller to that one device. Two or three devices is no problem. Every one you add costs the controller another GPIO pin, though, so a design with lots of SPI devices can run short of pins on select lines alone.

How It Works

The controller drives CS (chip select) LOW to begin talking to a specific peripheral. There's no start condition or address byte: CS itself is the framing. While CS is low, the controller toggles SCK, and on each clock edge one bit moves in each direction at once. The controller sends on MOSI while the peripheral sends on MISO at the same moment. The letters come from the original names, Master Out Slave In and Master In Slave Out. Newer datasheets say controller and peripheral instead (Controller Out, Peripheral In), but the pin names MOSI and MISO stuck around either way. Sending both ways at once is what makes SPI full-duplex. Unlike UART or I²C, both sides are always sending, whether or not either side has anything meaningful to say.

CS CS held LOW: this window is the entire frame SCK 0 1 0 0 0 0 0 1 MOSI = 0x41 ('A') 1 0 0 1 1 0 0 1 MISO = 0x99 Same 8 clock edges, both bytes at once, MSB first. That's "full-duplex".
CS is the only framing SPI has. No start bit, no address, no ACK. While it's held low, each of the 8 clock edges moves one bit on MOSI (here spelling 0x41, 'A') and one bit on MISO (here 0x99) at the same instant, MSB first, regardless of whether either side has anything useful to send.

On the Sniffer Board

Top view of the sniffer board with the red SPI header outlined in a red box
 The SPI header is the red one, boxed in red. Pins run from pin 1 at the top: CS, MISO, MOSI, SCK, GND.

The SPI peripheral here is a real EEPROM. The controller sends a read command on MOSI (an opcode byte plus a two-byte address), and the EEPROM answers on MISO with the requested data. All four wires need to be captured to see the full exchange: the first few bytes on MOSI are the read command, and the interesting content is on MISO afterward.

SPI header pins
PinConnects to
CSLogic analyzer channel D0
MISOLogic analyzer channel D1
MOSILogic analyzer channel D2
SCKLogic analyzer channel D3
Logic analyzer GND wire

In PulseView: 4 MHz sample rate, 10 M samples (2.5 seconds). Add the SPI decoder and assign CS# = D0, MISO = D1, MOSI = D2, CLK = D3 (PulseView's name for the header's SCK pin).

The decoder's other settings (clock mode, chip-select polarity, bit order) are for you to check against your capture: zoom in on one transfer and compare it with the diagram above. If the bytes come out as garbage, those settings are the first place to look.

PulseView capture of the SPI header: CS on D0 held low, MISO on D1 carrying data, MOSI on D2 idle low, SCK on D3 in bursts of eight pulses.
The SPI header in PulseView CS on D0, MISO on D1, MOSI on D2, SCK on D3: the clock comes in bursts of eight, one per byte, while CS stays low for the whole transfer.