External SPI Bus "Hub"?

For a while, I've wondered if there was some kind of external SPI "Hub" PCB you can buy, to allow one to easily connect/disconnect multiple SPI slaves, to and from a single Hardware SPI bus. As well as for delivering power to each slave. With all the connections being made over wires.

Something that can work reliably for prototyping and/or finished projects.

I've seen a few of these for use with the I2C bus, like the examples below:


But I have never seen such a thing for SPI.

Here is an illustration of what I mean:

In the image above, you would have either a +5v or +3v rail & GND, connected to PWR:IN and GND:IN, and the Arduino (SPI Master) supplies it's SPI pins (SCK:IN, MISO:IN and MOSI:IN) along with 3 or more slave select pins. These SPI master inputs then branch out into 3 or more Slave Outputs. The inputs or outputs could be header pins, terminal blocks etc.

Does anyone know of such a module, or open-source PCB design? I've searched for a while and have come up with nothing thus far.

If not, then how would you design such a thing for general use? Of course, it wouldn't be too hard to solder something like this to prototype board using pin headers, but I'd be interested to know any other design ideas/considerations one could make, perhaps concerning noise, cross talk, ease of use, etc.

I'm also interested in any other methods of wiring up multiple slaves to an SPI bus, which worked well, and which also provide a decent level of modularity.

Thanks.

Each SPI device needs a Select signal which is not part of the bus.

With a multiplexer it's possible to e.g. build a 8 device hub with only 3 address lines to the master. Then each slave has the address assigned by the slot where it is plugged in, just like in your diagram where you missed to number the slave slots correctly. Then it's easy to break a project if a slave is plugged into the wrong slot and does no more react on its expected address.

Sorry, I botched my original schematic. Now it's fixed.

I was just looking for an existing product, or advice/ideas for a custom design, which would allow one to more easily connect a single master to multiple slaves, using the standard SPI topology (1 master, multiple slaves), in which each slave gets selected/deselected with their respective CS pin. Not looking for a multiplexer.

I think that you did not fully understand the problem of selecting the right slave.

I don't think that @DrDiettrich was talking about an analogue multiplexer; more than likely something in the line of https://assets.nexperia.com/documents/data-sheet/74HC_HCT238.pdf so you only need to use 3 lines to select one-of-eight devices.

1 Like

Ok, apologies if I made the original question too confusing, or if I am misunderstanding some of the SPI terminology.

I was just looking for some kind of modular PCB that would make the wiring of multiple hardware SPI slaves easier, such as the 4 * BME280 Sensors shown in the image below:


Something akin to one of those I2C "hubs" below, except that you also plug all of the required CS pins into the input of the hub.

i.e. instead of the I2C hub below, with the inputs of GND,VCC,SDA & SCL, you have an SPI hub with the inputs of GND, VCC, SCK, MISO, MOSI, CS 1, CS 2, CS 3... and so on. You only attach as many CS pins as there are slaves to the hub.

The common bus signals can be transported in a flat ribbon cable, with standard press-on connectors. Routing the bus signals and CS to the slaves has to be hand crafted according to the pinout of the various slave modules. I don't see how a PCB can simplify anything more.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.