SPI#
Synchronous serial. Four wires plus ground; one side drives the clock, both sides shift bits on every edge. No addressing on the wire — the master selects a slave by pulling its chip-select low. The bus on every SPI flash, EEPROM, SD card, and a fair share of sensors. Pull firmware off an SPI flash in a few hundred milliseconds with a clip and a programmer.
Wires#
Signal |
Direction |
Purpose |
|---|---|---|
|
Master out |
Clock; defines bit timing. |
|
Master out |
Master Out, Slave In. |
|
Master in |
Master In, Slave Out. |
|
Master out |
Chip select, active low; one per slave. |
|
Reference |
Ground. |
Wire format#
Logic levels are CMOS, typically 3.3 V or 1.8 V. The master holds
CS high to idle, pulls it low to start a transaction, drives
SCLK, and shifts bytes MSB-first on MOSI while sampling
MISO.
Four modes set the clock polarity (CPOL) and phase (CPHA).
Mode |
CPOL |
CPHA |
Idle |
Sample on |
|---|---|---|---|---|
0 |
0 |
0 |
Low |
Leading (rising) edge |
1 |
0 |
1 |
Low |
Trailing (falling) edge |
2 |
1 |
0 |
High |
Leading (falling) edge |
3 |
1 |
1 |
High |
Trailing (rising) edge |
Speeds run from a few hundred kHz on a slow sensor to 100+ MHz on a quad-SPI flash. Most parts default to mode 0.
sequenceDiagram
participant M as Master
participant S as Slave
M->>S: CS low
M->>S: SCLK + MOSI byte (command)
S-->>M: MISO byte (response)
Note over M,S: Repeat for as many bytes as the command requires
M->>S: CS high (end transaction)
Pads#
SPI flash and EEPROM chips are the operator’s most common SPI
target. The 8-pin SOIC 25xx flash family has a fixed pinout
that a SOIC-8 test clip mates to without desoldering.
Pin |
Signal |
|---|---|
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
Tools#
Tool |
Effect |
|---|---|
|
Dump and write SPI flash; the operator’s first reach for firmware extraction. |
|
USB-to-SPI bridges that drive the bus from a host. |
SOIC-8 test clip ( |
Mate to a flash chip in-circuit without desoldering. |
Logic analyzer ( |
Decode SPI traffic in flight. |
|
Userspace SPI access on Raspberry Pi and similar boards. |