SPI/A whole conversation/More than one device
Lesson 10 of 14 · in 3D and VR

More than one device

Peripherals share the clock and the two data wires, and each gets a chip select of its own. A daisy chain saves the pins by threading them into one long shift register, and pays for it in clocks.

Lonely BinaryUpdated 2026-09-304 min readNo board required

View it in VR

Lesson 10 of the SPI course opens in a VR headset, on a table in front of you, and a voice starts three seconds after you arrive. Type this short address into the browser on a headset such as Meta Quest or Apple Vision Pro, and press Enter VR. No headset? Press Start the lesson: the same lesson, full screen.

learn.lonelybinary.com/vr/spi/10

A board with a display, a sensor and a flash chip still has one set of SCK, MOSI and MISO wires. All three peripherals hang on them, and chip select tells them apart.

One chip select each

Every peripheral has its own CS wire back to the controller. The controller pulls one low, and only that peripheral listens and drives MISO. The others ignore the clock and leave MISO alone. Three peripherals cost three CS pins, ten cost ten, on top of the three shared wires.

The trap is a peripheral that keeps driving MISO when it is not selected. The W25Q128 datasheet says its output goes high-impedance when /CS is high. Some SD cards do not let go, so check the part.

The daisy chain

The other wiring is a chain. The controller's MOSI goes into the first peripheral. Each peripheral's output goes into the next one's input, and the last one's output comes back to MISO. SCK and one CS are shared by all of them, and the registers become one long shift register.

The Maxim MAX7219 display driver is made for this. Its datasheet says the data into DIN appears at DOUT 16.5 clock cycles later. Each chip takes 16 bits, an address byte and a data byte, so a chain of N chips needs 16 × N clocks, not 8 × N. The first pair sent ends up in the last chip, and the chips take the last 16 bits they hold when the load line rises.

The trade

A chain needs four wires however long it is, and every message is as long as the chain. To change one chip you still send bits for all of them. Separate chip selects cost pins, and let you talk to any one peripheral in the time one message takes.

Common mistakes

  • Counting 8 clocks per chip on a MAX7219 chain. It needs 16, and the wrong count puts each byte in the wrong chip.
  • Sharing one CS between peripherals that are not chained. They all hear the same bytes, and they answer together on MISO.
  • Chaining a peripheral that has no output for the next one. The MAX7219 has DOUT for it; most SPI parts have nothing.

Edit this page — content/fundamentals/spi/more-than-one-device.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.

Browse Fundamentals on the forum →