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.

TCA9548A: Using multiple TCA9548A on the same I2C bus, but communication is weird.

Part Number: TCA9548A
Other Parts Discussed in Thread: LM36011

Hello,

In my design I am using two TCA9548A connected to the same I2C bus from Arduino uC, and I have 8 LM36011 LED drivers connected to each TCA9548A. And all of the LM36011 LED drivers have same I2C address. 

I did set unique i2C address with A2-A0 pins so they have different addresses, for example, one is 0x70 and the other one is 0x71. 

Strange things happens when I call the CH1 of 0x70 device with Wire.h library, some channels from 0x71 is also responding, but all of the other channels from 0x70 stays quiet (which is expected). 

The codes I was using is attached as below.

  1. #include "Wire.h"
  2. extern "C" {
  3. #include "utility/twi.h" 
  4. }
  5.  
  6. #define TCAADDR_A 0x70
  7. #define TCAADDR_B 0x71
  8. void tcaselect(uint8_t i) {
  9. if (i > 7) return;
  10. Wire.beginTransmission(TCAADDR_A);
  11. Wire.write(1 << i);
  12. Wire.endTransmission();
  13. void tcaselect(uint8_t i) {
  14. if (i > 7) return;
  15. Wire.beginTransmission(TCAADDR_B);
  16. Wire.write(1 << i);
  17. Wire.endTransmission();
  18. }

And seems the channels responded from 0x71 devices is quite random, it varies from board to board. 

There must be something wrong but I don't quite understand why it happened. Can you please help?

  • Hello,

    I think you are missing a semicolon:

    "

    1. void tcaselect(uint8_t i) {
    2. if (i > 7) return;
    3. Wire.beginTransmission(TCAADDR_A);
    4. Wire.write(1 << i);
    5. Wire.endTransmission(); } // here I think unless you were trying to include the other function (with the same name?)

    "

    I suspect you may have just copy pasted this incorrectly to the forum and this is likely not the cause.

    We can try to see if the issue is on the I2C side by looking at scopeshots of the SDA/SCL lines. Are you able to get scopeshots of this?

    it may also help if we review a block diagram of the I2C bus and the schematic for our device.

    Thanks,

    -Bobby