0
\$\begingroup\$

I want to provide 12 actuators from a microcontroller (Particle Core) over I2C. The problem is that the drivers for the actuators have all the same I2C addresses. So I'am considering to use I2C multiplexers. However I only have found a 1 to 8 channel I2C multiplexer like the TCA9548A from Texas Instruments. The idea now is that I have 1 multiplexer connected directly to the microcontroller. This multiplexer is connected to 3 further multiplexers and each of them is connected to 4 actuator drivers. My question now is, if it is possible to nest such I2C multiplexers? Thanks in advance!

\$\endgroup\$
9
  • \$\begingroup\$ What is the I2C driver? \$\endgroup\$
    – Andy aka
    Commented Dec 17, 2015 at 14:28
  • \$\begingroup\$ Related question about address conflicts: electronics.stackexchange.com/questions/5096/… \$\endgroup\$ Commented Dec 17, 2015 at 14:40
  • 2
    \$\begingroup\$ From that question, there exist ICs like this one which when placed in between the master and an I2C slave will actually translate the address on the fly. E.g. you can have every device with the same address, but place a translator in front of each that maps them all to a different address on the master side. \$\endgroup\$ Commented Dec 17, 2015 at 14:42
  • \$\begingroup\$ @Andyaka DRV2605 from TI is used as motor driver \$\endgroup\$
    – Ditachi
    Commented Dec 17, 2015 at 15:09
  • \$\begingroup\$ @TomCarpenter: Your second comment would be an excellent answer I'd certainly upvote! \$\endgroup\$
    – EM Fields
    Commented Dec 17, 2015 at 15:15

2 Answers 2

1
\$\begingroup\$

In terms of your question directly, yes it should be possible to stack the multiplexers, as long as each layer of mux has a different address from the previous layer. For example, if you stack two multiplexers deep in the following sort of arrangement:

   L1     L2

          /|---
    /|---|B|
   | |    \|---
---|A|
   | |    /|---
    \|---|C|
          \|---

Then the multiplexers are L1 would have one address to control these select lines, and then the multiplexers at L2 need an address different to that of L1. A could have an address of 0x10 and both B and C could share the same address of 0x12 for example.

For this to work, you would first send a packet to mux A to select which of the second level muxes you want to talk to. Then you would send a packet to either B or C to select which device to talk to. Then you could send packets to your device. This could take up to 40 or more I2C bit periods before you could talk to one of the devices. The deeper you stack them, the higher the overhead.


While not directly answering the question of whether mutliplexers can be stacked, there are alternatives. There is a related question here which is about I2C address conflicts. @user3608541 points out in his answer that there exist ICs which can perform address translation. Specifically he gives an example of the LTC4316.

To expand on that answer, these ICs perform address translation on-the-fly. Essentially they connect in line between the I2C master and slave devices and monitor communication between the two. When a start bit is sent, the following byte is always the address of the device. The address translation IC monitors for the start bit, and once detected will make modifications to the address as it goes through. In the case of the LTC4316, the modifications are simple addition - the master sends one address, and the slave receives the packet but with the address having had some constant factor added on to it. The rest of the packet goes through unmodified.

The net result of this is if you have many copies of the same fixed-address device, you can place each one behind an address translation IC, and configure the ICs to add on different factors. For example, the first one adds on 1, the second adds on 2 and so on. This would mean that to contact the first slave, the master would have to talk to its address minus 1. To talk to the second slave the master would have to minus 2. This gives each one a unique address.

Now whether these ICs are cheaper than multiplexers, I don't know (a quick DigiKey search shows them at $3 each for low quantity), but they have a distinct advantage in that you don't have the extra overhead of time spent selecting the correct output of the multiplexer.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks for the quick and detailed answer! This helps me a lot! \$\endgroup\$
    – Ditachi
    Commented Dec 17, 2015 at 15:53
1
\$\begingroup\$

I don't think you actually need to nest the multiplexers. The TCA9548A allows you to turn off all downstream ports. So you could do what you want with just a pair of them connected to the main processor (and set to different addresses).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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