1
\$\begingroup\$

I have a large matrix of devices, "nodes", that I would like to address and communicate with - assume > 50 nodes. Each of the nodes have a controller that receives data from a central microcontroller and then performs a function.

I was thinking of using I2C for this but since the controllers will be the same, the number of addresses are limited to only as many variations the controller can provide. Is there a better way to address and communicate with this large grid of devices with minimal wiring? I initially chose I2C since it has just 2 wires (SDA, SCL) for bus functionality, apart from power and ground.

\$\endgroup\$
  • 1
    \$\begingroup\$ Please give some more information about the slaves, and how the network needs to work. What data rate is needed to each slave? How quickly must all slaves be contacted? What microcontrollers are you considering for the 'central controller' and 'slaves'? Do slaves ever communicate directly? Physically how big is the system, i.e. how far between the 'central controller' and 'slaves'. Is cost an issue? \$\endgroup\$ – gbulmer Sep 29 '14 at 17:42
1
\$\begingroup\$

You are effectively describing a "single master, multiple slave" arrangement. When working with such a setup, the first two approaches that come to mind are SPI and I2C.

Personally, I veer away from SPI unless I'm only concerned with a small number of slave devices (low chip count), or it's the only interface available. This is primarily because you'll need a dedicated slave-select line for each slave device, consuming another GPIO pin on your MCU/CPU, or you'll need additional multiplexing circuitry in place to save your spare pins. The one added benefit of this is that you can "broadcast" to groups of devices at the same time (assuming they don't reply to you) rather than having to broadcast to the entire bus like you do with I2C.

I2C isn't bad at all, even for a large number of devices. If you want 50 slaves, you'll need at least one of:

  1. all of your devices to either support 6 programmable address bits (either via flashing it into the chips in advance or the use of Vcc/GND address pins)
  2. if your MCU/CPU has multiple I2C busses, you can split up groups of chips to share individual busses, allowing you to need smaller programmable address ranges
  3. select chips such that they use non-overlapping ranges of I2C addresses.

Additionally, I2C has the added benefit of being able to handle voltage mismatches easily if the master and slaves communicate at different logic levels (ie: 3.3VDC vs 5.0VDC).

\$\endgroup\$
0
\$\begingroup\$

You could use a daisy chained SPI type configuration where the address of the node device depends on it's position on the harness. You won't need any slave select lines and the node devices won't require a fixed address.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.