I2C connection on MEGA 2560 R3

Hi, wonder if anyone have problem with using I2C connection on mega2560 R3?
I ran I2C scanner on three recently bought mega2560 boards from keystudio, SunFounder and ELEGOO ( twice) and none of these detected I2C connections, whereas my old ELEGOO I2C works fine.
Not sure if there's any brand you would recommend?
Thank you very much

What pins did you use? The I2C pins are in a different location on the Mega. Is your "old Elegoo" an Uno or other Arduino?

What connections did you establish, how?

Hello my friend
You will find the solution here

the old Elegoo is mega 2560 as well.
both have scl pin 21 and sda pin 20

thanks for the note, guess I could buy the 5v to 3.3v to try, though I'm using TCA9548A and it seems to have that functionality built in..
and I did try I2C scanner ( nothing turned up)

wish I could post picture here but I'm connecting mega 2560 with tca9548a I2C multiplexer, which has 3 MPU6050 connected, and the TCA9548A and MPU6050 shared 3.3V power supply. the SDA and SCL from the 3 MPU6050 are connected to 3 sets of SCL and SDA "input" on the TCA9548A, and the TCA9548A "main " SCL and SDA are connected to mega 2560 SCL and SDA, so when I connect the "main" SCL and SDA to the old ELegoo mega 2560, I2C scanner and my program work, but if I just un-plug the "main" SCL and SDA from the old mega 2560 to the newly bought one, I2C scanner and my program stopped working, complaining couldnt find any I2C device

Do you have any 5V I2C device around for testing? Another Arduino as slave?

Reminds me... check your non-working board to see whether it has pull up resistors. Does your I2C device have them?

I just caught up with your posts... you have multiple I2C loads. Perhaps there are too many pull ups? Another potential problem is the mixed 3.3V and 5V bus. It can be done, but I think there may be some caveats.

You should not be testing with all that stuff. First just connect one device and then move to more when it works.

The I2C multiplexer turns only selected channels on and also is a level shifter. No problems so far.

@DrDiettrich unfortunately I dont have another 5v I2C device..., I did try using a different TCA9548A, same thing, works on the old Elegoo, not on any of the newer ones.

@anon57585045 I measured between scl and sda on the I2C device( TCA9548A) when it's disconnected and powered off, its 20k ohm, and it's the same values for the working board and non-working boards.
I did try connect only one I2C on the multiplexer and got the same results, works on the working mega 2560 and doesnt work on the non-working 2560s

That's a weird way to measure pull ups, I would measure each one between SDA-Vcc and SCL-Vcc because that is where the resistors would be connected... I suppose you're seeing both resistors in series now...

Maybe your problem is as simple as a defective board! You could ohm the traces back to the CPU pins to make sure there is continuity...

ah good point these two are 10k ohm each. I traced a bit and gave up today, too tiny to trace all the way lol. Thanks though

What about the traces? Are they continuous back to the CPU?

Can u please share your code that works with 3 mpu6050 and a tca9548a ?

@ismailc, it's unlikely that the thread starter will see this request, and it's off topic. Please just send the person a private message.

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