SER-18 SPI chip select shared, or a MISO that does not tri-state¶
| Severity | Status | Implementation |
|---|---|---|
| error | planned | mid, depends on NET-7 |
Looks at. SPI pin roles, slave MISO behaviour (part data).
What it catches. Two SPI slaves on the same CS net, or a slave on a shared MISO that does not release MISO (high impedance) when deselected, or only after extra clocks.
Why it matters. With a shared CS both slaves answer at once: MISO is a fight between two push-pull outputs and writes reach both. A slave that keeps driving MISO while deselected corrupts every read from the other slaves. SD cards in SPI mode are the classic case: they release MISO only after one more byte of clocks with CS high, and before they are put into SPI mode they may answer traffic meant for other devices.
Example. An SD card socket and a W25Q flash on one SPI bus of an RP2040: the flash reads fail right after an SD transfer, until the firmware sends a dummy byte after deasserting the card's CS.
How to check. Count slaves per CS net (NET-7); for slaves on a shared MISO, look up part data for "MISO tri-states when deselected" (SD in SPI mode: only after a clock byte; some sensors and ADCs never).
Fix. One CS per slave; for slaves that do not release MISO, a tri-state buffer (74LVC1G125) gated by its CS, or a separate bus; for SD cards, initialise them first and clock a byte after CS goes high.
References. Wikipedia, Serial Peripheral Interface "Multidrop configuration"; ELM MMC/SDC "Consideration on Multi-slave Configuration"; PJRC SPI (step 2, tri-state buffer).