This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TCA9546A: Dynamic addressing for I2C switches in series

Part Number: TCA9546A
Other Parts Discussed in Thread: TCA9548A

Hi I am using tree-like architecture using I2C switches TCA9546 and TCA9548 at two levels. Could I get a help in defining the sequence of I2C commands (of SCL/SDA signal from the controller) for setting the configuration of slave device in final layer? thanks, Shalaka

  • Hey Shalaka,

    Can you provide a block diagram of how your I2C tree looks like? This would help us with trying to suggest the I2C commands. (Please include slave addresses)

    Thanks,

    -Bobby

  • I though I had attached it.

    Please find below.

  • Hey Shalaka,

    For this case, it doesn't look like you would need to implement a dynamic addressing set up though if you are interested you can read about it here: http://www.ti.com/lit/pdf/scaa137

    So for the controller to ensure we do not run into address conflicts we must:

    1) never enable channel 0 and channel 3 of TCA9546A

    2) never enable multiple channels of any of the TCA9548As (only one channel may be enabled at a time

    An example of a transaction where we want to communicate to channel 6 of TCA9548A 0x72 would look like:

    1) start condition--> 0x70h (we need to set up 9546A channel 0 to be on) + write bit {this would look like 0xE0h in an 8 bit byte format}--> 9546A should ACK

    2) send data packet: 0x01h (this enables channel 0 only) --> stop condition

    3) start condition--> 0x72h (we need to set up 9548A channel 6 to be on) + write bit {this would look like 0xE4h in an 8 bit byte format}--> 9548A should ACK

    4) send data packet: 0x40h (this enables channel 6 only) --> stop condition

    Now you can communicate with slave on channel 6

    --------------------------------------------

    I also noticed you are cascading the switches. Any reason why you don't just get rid of the TCA9546A and pyt the three 9548As in parallel. You could then set one of the addresses of the switches to be 0x70h, 0x71h, and 0x72h which would allow for unique addresses across the the three switches.

    Thanks,

    -Bobby

  • Hi Bobby,

    Thanks a lot for the detailed response, looks like I was on the right path then :)

    This diagram was just for an example, we have many more devices connected to almost all the channels hence had to use 2 levels of switches.

    I have one more question in this regard, after communicating with final slave, how do I come a level back or to an initial level before TCA9546? Do I need to disable all the channels or something?

    thanks,
    Shalaka

  • Hey Shalaka,

    "I have one more question in this regard, after communicating with final slave, how do I come a level back or to an initial level before TCA9546? Do I need to disable all the channels or something?"

    So there are two ways to handle this. (Yes disable all channels like in step 1)

    1) If you have completed all the transactions you need to on the said channel of interest (lets use channel 6 of 0x72h like the last example) then you would write to the slave of 0x72h switch and write 0x00h (this is the byte which would disable all channels for that switch). After that you would write to the 9546 address 0x70h and write 0x00h to disable all the channels on that switch as well. This would bring you back to a similar state as when you powered up in terms of I2C switch channel states being all disabled.

    2) Just toggle the reset pin of the 9546 and 9548 devices. Reset toggle will put the device in it's default state where all channels are disabled.

    Thanks,

    -Bobby

  • But can't I come just one step back?

    Let's say I complete the communication with slave on channel 6 of 0x72 and want to come only one step back to start communicating with channel 7 of 0x72.

    Is that possible without going to initial level of 0x70?

    Also, even if slave addresses on multiple TCA9548 devices are same, I can use general call address to broadcast the data right?

    thanks,

    Shalaka

  • Shalaka Shinde said:

    But can't I come just one step back?

    Let's say I complete the communication with slave on channel 6 of 0x72 and want to come only one step back to start communicating with channel 7 of 0x72.

    Is that possible without going to initial level of 0x70?

    Yes, you can do this too. I assumed you wanted to close out all of your I2C switch channels. You can continue to keep using channel 0 of 0x70h and just change the channel of the 9548's 0x72h address to be channel 7 instead of 6.

    Also, even if slave addresses on multiple TCA9548 devices are same, I can use general call address to broadcast the data right?

    The Texas Instruments I2C slave devices do not support the general call address (none that I am aware of anyways). so you would not be able to do a quick write to all of the switches at the same time.

    thanks,

    Shalaka

    [Bobby] comments above in bold

  • Great!

    This helped a lot Bobby!

    Thank you.