TCA9548A Finding Random Address and Not Working Correctly

Hi All,

I'm trying to use TCA9548A (and actually have 2 i've tested because of this issue) and I just can't tell what I'm doing wrong.

I will start with the basic TCA tester sketch that can be found online:

#include "Wire.h"

#define TCAADDR 0x77

void tcaselect(uint8_t i) {
  if (i > 7) return;
 
  Wire.beginTransmission(TCAADDR);
  Wire.write(1 << i);
  Wire.endTransmission();  
}


// standard Arduino setup()
void setup()
{
    while (!Serial);
    delay(1000);

    Wire.begin();
    
    Serial.begin(115200);
    Serial.println("\nTCAScanner ready!");
    
    for (uint8_t t=0; t<8; t++) {
      tcaselect(t);
      Serial.print("TCA Port #"); Serial.println(t);

      for (uint8_t addr = 0; addr<=127; addr++) {
        if (addr == TCAADDR) continue;

        Wire.beginTransmission(addr);
        if (!Wire.endTransmission()) {
          Serial.print("Found I2C 0x");  Serial.println(addr,HEX);
        }
      }
    }
    Serial.println("\ndone");
}

void loop() 
{
}

This simple code should check what I2C addresses are found on each port of the TCA multiplexer, but when I run it the Serial monitor finds 3 addresses on each port when there is literally nothing connected!

TCAScanner ready!
TCA Port #0
Found I2C 0x60
Found I2C 0x6A
TCA Port #1
Found I2C 0x60
Found I2C 0x6A
TCA Port #2
Found I2C 0x60
Found I2C 0x6A
TCA Port #3
Found I2C 0x60
Found I2C 0x6A
TCA Port #4
Found I2C 0x60
Found I2C 0x6A
TCA Port #5
Found I2C 0x60
Found I2C 0x6A
TCA Port #6
Found I2C 0x60
Found I2C 0x6A
TCA Port #7
Found I2C 0x60
Found I2C 0x6A

done

Here is what my layout looks like exactly:

  • I'm using a Nano 3.3 IoT


Why is it finding 2 addresses on the ports that have nothing connected to them?
Am I missing something fundamental here?

Any help is appreciated as when I connect I2C components to the Multiplexer it is not working correctly, so I figured I would start back from the basics, but clearly I don't have that figured out yet.

Thanks,
Ben

Oh one more thing to note; when I add an I2C component to the I2C bus connected to the Arduino this is also found by the ports (all 8 of them) during the multiplexer test for some reason.

Hello Ben

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the Installation & Troubleshooting category.

I seem to remember that there was another topic recently where similar symptoms were described; maybe a search on the forum or a google will reveal it.

Do you have the mandatory 4K7 pull-ups on the I2C lines ?

They could be on the modules, but unlikely.

I dont have any I2C components connected to TCA9548A.

For the TCA itself Adafruit doesnt specify requiring any on their installation guide, and every other circuit ive seen working doesnt have any between the TCA and Arduino.

Are we saying I need one on the TCA to Arduino I2c bus?

But the TCA is connected via I2C
Screenshot 2022-10-14 170455

That would be correct. If your device is on the Arduino side of the multiplexer, then it will always be seen during the I2C scan regardless of the multiplexer settings.

I will try with pull up resistors and see, but ive never seen them on any other application.

Ok, thanks for the explanation.

Do you know what the other 2 addresses could be that it is finding?

It is finding these addresses when no I2C device other than the TCA is connected.

Yes. They are the ECC608A Authenticator chip (0x60) and the LSM6D IMU (0x68). These are both I2C devices and they are on your Nano 33 IoT board.

1 Like

Thank you, that helps me a lot!

So it appears that without components on the TCA it is working correctly; maybe now i need to figure out why it doesnt when components are connected to it.

So when I connect a sensor to the TCA, say port 2 and run the Multiplexer tester script, the address of that sensor also appears on all ports again even though it's only connected to 1 port.
In addition there is 0x0 now appeared for who knows what reason.

Here is the results:


TCAScanner ready!
TCA Port #0
Found I2C 0x0
Found I2C 0x5A
Found I2C 0x60
Found I2C 0x6A
TCA Port #1
Found I2C 0x0
Found I2C 0x5A
Found I2C 0x60
Found I2C 0x6A
TCA Port #2
Found I2C 0x0
Found I2C 0x5A
Found I2C 0x60
Found I2C 0x6A
TCA Port #3
Found I2C 0x0
Found I2C 0x5A
Found I2C 0x60
Found I2C 0x6A
TCA Port #4
Found I2C 0x0
Found I2C 0x5A
Found I2C 0x60
Found I2C 0x6A
TCA Port #5
Found I2C 0x0
Found I2C 0x5A
Found I2C 0x60
Found I2C 0x6A
TCA Port #6
Found I2C 0x0
Found I2C 0x5A
Found I2C 0x60
Found I2C 0x6A
TCA Port #7
Found I2C 0x0
Found I2C 0x5A
Found I2C 0x60
Found I2C 0x6A

done

Here is the exact circuit diagram:

  • I'm using a MLX with an integrated I2C board that does not need pull up resistors; when I connect it directly to the Arduino, it functions correctly.


Am I doing something wrong here?
Should it show up on all ports?

I put some pull-up resistors on the sensor wiring (4K7) and now the address for this sensor is missing and only the 0x0 appears.

TCAScanner ready!
TCA Port #0
Found I2C 0x0
Found I2C 0x60
Found I2C 0x6A
TCA Port #1
Found I2C 0x0
Found I2C 0x60
Found I2C 0x6A
TCA Port #2
Found I2C 0x0
Found I2C 0x60
Found I2C 0x6A
TCA Port #3
Found I2C 0x0
Found I2C 0x60
Found I2C 0x6A
TCA Port #4
Found I2C 0x0
Found I2C 0x60
Found I2C 0x6A
TCA Port #5
Found I2C 0x0
Found I2C 0x60
Found I2C 0x6A
TCA Port #6
Found I2C 0x0
Found I2C 0x60
Found I2C 0x6A
TCA Port #7
Found I2C 0x0
Found I2C 0x60
Found I2C 0x6A

done

Had similar issue and just solved it by resetting the register with 0, it is not the most elegant but it works

void tca_select(uint8_t i) {
  if (i > 7) return;
  Wire.beginTransmission(TCA_ADDR);
  Wire.write(0x00);
  Wire.endTransmission(); 

  Wire.beginTransmission(TCA_ADDR);
  Wire.write(1 << i);
  Wire.endTransmission();   
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.