AtMega328p and TCA9548 problem

Hello everybody,

I have a custom made PCB that has an AtMega328p MCU and 4 MLX90614 IR Sensors that are being interfaced by a TCA9548 I2C Multiplexer.

When I first got my hands on the board I had 10k pull-up resistors on all I2C lines but the output was unpredictable (sometimes it worked and others it didn't). I then swapped them all for 4.7k and at first everything worked fine. Upon reboot all hell broke loose.

If I run i2c_scanner from the Wire.h example the chip is detected at its correct address. But if I upload another sketch to scan each of the ports, the Wire.endTransmission() function hangs.
I have coneccted only ports 2-5 due to constraints in my design.

Does anyone have any idea what the problem might be ?

P.S. I have attached my code for port scanning
P.S. If it is not suitable for this thread, point me where I should post it

TCA9548_ScanConnectedIDs.ino (1.02 KB)

Actually found the solution to the problem. I was using 10k pull-up resistors initially and when I replaced them with 3.3k Ohms everything worked fine

I am very interested in this matter. But still did not get into something