
Chip select
SPI has no addresses, so every peripheral gets a chip select wire of its own. The controller pulls one wire low to say who is being spoken to, and every other peripheral must let go of MISO.
An I2C bus names the chip it wants in every message. An SPI bus never names anyone. SCK, MOSI and MISO run past every peripheral, and the only thing that says who is being spoken to is a wire of its own, chip select, printed CS, SS or /CS on a datasheet.
Low means listening
Chip select is active low. The wire rests high, and the controller pulls it to ground to select one peripheral. The Winbond W25Q128JV flash puts it plainly: with /CS high the device is deselected. Motorola's S12SPI block guide holds it low until the transfer ends. A few parts are active high, so the datasheet decides.
One wire each
The controller needs one chip select pin for every peripheral. Three peripherals mean three pins, while SCK, MOSI and MISO are shared.
With one peripheral you can skip it. Tie the select to ground and pass -1 as the pin: spics_io_num in ESP-IDF, or ss in SPI.begin() on the ESP32. TFT_eSPI tells you to do this for an ILI9341 display when nothing else shares the bus. The ILI9341 datasheet promises a permanently low select only for its parallel interface, so over SPI it works in practice.
What you give up is the frame. The W25Q128JV starts an instruction on the falling edge and finishes it on the rising one, so it cannot work tied low. The BME280 ends a burst read only when CSB rises. A display that slips by one bit can then be put right only by reset or by power.
Hands off MISO
Only the controller drives MOSI. MISO is shared, and only one peripheral may drive it at a time. So a deselected peripheral must release MISO, leaving it in high impedance, driving neither high nor low. The W25Q128JV datasheet says its output pins are at high impedance while /CS is high.
Select two peripherals at once and both answer. One pushes MISO high while the other pulls it low, and the controller reads a level that belongs to neither. Nothing reports an error.
Common mistakes
- A chip select that is low by accident. An old initialisation or a floating pin selects a second peripheral. Drive every select high first, then make it an output.
- Assuming every peripheral releases MISO. Check its datasheet before you share the line.
- Tying a select low to save a pin, then adding a device. A second peripheral hears every byte meant for the first.
Edit this page — content/fundamentals/spi/chip-select.mdx
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.