Sub topic 16
Daisy Chaining, Dual SPI, and Quad SPI
This chapter assumes you understand standard SPI transfers, chip-select framing, register commands, and Arduino SPISettings. These variants extend SPI to connect devices or move more data per clock. They are usually device-specific, so always check the peripheral datasheet before wiring or coding.
Daisy chaining
In a normal SPI bus, each peripheral has its own chip-select line. A daisy-chained bus connects peripherals in a series:
- The controller's MOSI connects to the first device's input.
- The first device's output connects to the second device's input.
- The final device's output connects back to the controller's MISO.
- All devices share SCLK and chip select.
Every clock pulse shifts one bit through each device. To send a command to the last device, the controller may need to transmit bytes for every device in the chain. Each device keeps the bytes intended for it and passes the remaining bits onward.
Daisy chaining can reduce chip-select wiring. It works best when devices support the same chain format and can pass data through while selected. The disadvantages are longer signal paths, more complicated frame formats, and failure propagation. One disconnected device can interrupt every device after it.
Dual SPI and quad SPI
Dual SPI and quad SPI increase throughput by using multiple data wires in parallel.
| Variant | Data wires | Bits transferred per clock | Common use |
|---|---|---|---|
| Standard SPI | 1 input, 1 output | 1 in each direction | Sensors and displays |
| Dual SPI | 2 shared data wires | 2 | Flash memory |
| Quad SPI | 4 shared data wires | 4 | High-speed flash and program storage |
In standard SPI, MOSI carries data to the peripheral and MISO carries data back. In dual or quad operation, the data pins become bidirectional. A command can begin in standard mode, then tell the peripheral to use two or four data lines for an address or payload.
This arrangement can transfer more data without multiplying the clock frequency. It still requires compatible hardware, pin control, and a device protocol that defines when each line changes direction. An ordinary Arduino SPI peripheral usually cannot perform quad transfers through SPI.transfer() alone. You may need a microcontroller with a dedicated QSPI controller and a matching library.
Choosing a variant
Use separate chip-select lines when devices have ordinary SPI interfaces and independent commands. Consider daisy chaining when the devices explicitly support it and wiring simplicity matters more than independent access. Choose dual or quad SPI when a compatible controller and peripheral must move large blocks quickly, such as firmware from external flash.
The main trade-off is complexity. More data lines can improve throughput, but they also increase pin usage and make timing, routing, and debugging more demanding.
Exercise
Why can quad SPI transfer more data per clock than standard SPI, and why can an ordinary SPI library fail to support it?
Show answer
Quad SPI uses four data lines in parallel instead of one data line in each direction. An ordinary SPI library may control only MOSI, MISO, and SCLK, while quad transfers require bidirectional pin control and device-specific timing.