I'm designing a few PCBs for a project:
- Microcontroller PCB (SPI master)
- Sensor PCB, where each sensor PCB has several SPI slaves on it.
In a full system, there would be 3 sensor PCBs directly plugged into 3 connectors on the microcontroller PCB. In certain scenarios, not all 3 sensor PCBs will be present.
My question is about best practices/approach for sharing a single SPI controller across all 3 sensor PCBs. I'm planning to run the SPI bus at 20 MHz and the longest end-to-end trace length between the microcontroller and SPI slave will be about 8 inches.
Some ideas I had:
- Use a 'SPI bus multiplexer' to isolate which Sensor PCB is connected to the SPI bus at any given time, but haven't had much luck turning up results. Was hoping to find something similar to a TCA9544A (I2C multiplexer).
- Use 4-bit tri-state buffer on the microcontroller board for each Sensor PCB interface. In this case, I'd have 3 of these on the microcontroller PCB. Using the output enable to connect/disconnect a sensor PCB from the shared SPI bus.
Update:
Here's a diagram of what I'm trying to do:
I suppose I'm more concerned with signal integrity and EMI/reflections. I believe I have an understanding of the functional connection aspects. How should I handle the inter-board connections, given that a sensor board may or may not be attached? Should I use tri-state buffers at the interface?