ABC of Electronics cosycom.com
ESP32 BASICS · LESSON 16

Reading Sensors and Displays over SPI

The four SPI wires, chip-select logic, and why SPI is the choice for fast displays.

SPI trades I2C's two shared wires for four dedicated ones, plus a separate chip-select line per device. That extra wiring buys considerably more speed, which is why fast displays and SD cards almost always use SPI instead of I2C.

ESP32 (master) Display (CS1) SD card (CS2) SCK / MOSI / MISO SPI: one master, one shared clock/data pair, separate select lines
SPI signal names
SignalMeaning
SCKClock, sets the pace of every bit transferred
MOSIMaster Out, Slave In — data leaving the ESP32
MISOMaster In, Slave Out — data returning to the ESP32
CS / SSChip Select — one per device, picks who's "listening"

Why chip-select matters

Because SCK, MOSI, and MISO are shared by every device on the bus, only one chip-select line should be pulled active (usually LOW) at a time — otherwise two devices try to answer at once and the data collides.

KEY IDEA
Adding a second SPI device to a project usually means adding one more chip-select pin, not four more wires.