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.

Software code for I2C channel selection

Hi,

 

We are using the Part “ TCA9548APWR” in our design.We are planning to test the specified  I2C mux against our
application specifications.Is there any “software coding” available for the mux to select the address and I2C Channel  lines?

  • Moving to I2C forum for support.
  • Hello Vishal,

    Thank you for the question.

    We do not have any code available for this switch, because the switch is designed to go into any I2C system, which encompasses a very large range of programming languages.

    In the datasheet, we outline the procedure needed to write to the device in order to select which channels you would like active.

    On page 14 and 15, you can see this description, but I will go over it briefly here as well.

    Depending on how you have your A2, A1, and A0 pins setup, your address can a variety of address (see page 14), I will assume that all address pins will be tied to ground, resulting in a device address of 0x70 (7 bits, right justified)

    You merely send the the address with the read bit low (0xE0, 8 bit (address + R/W)), and after the ACK, you send a byte with which channels you would like selected (see page 14 and 15).

    So, if you want channels 0 and 5 enabled, but no other ones, you would send the following 2 bytes over I2C: 0xE0, 0x21
    Once you send the stop bit after the ACK for this transaction, you will then be able to communicate with any slaves on channels 0 and 5.

    Please make sure that the address of your switch is not the same as any of your slaves, otherwise you will have issues when attempting to communicate to a slave.