Mega i2c pins not working

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
adamr1
 
Posts: 120
Joined: Sun Jun 02, 2013 8:24 am

Mega i2c pins not working

Post by adamr1 »

I am working on a project that includes the v2 motor shield, i2c fram unit, and a 8x8 matrix with i2c backpack. I had my project working great on an uno but I started to run out of memory and moved my project to a mega. I switched the i2c pins from A4&5 from the uno to 20 and 21 on the mega. I can't get any of the i2c components to work. I've tested motor shield, fram, and matrix seperatley and I cannot get them to function. For instance, when I run the fram example and enter the serial view, it just hangs but if I remove the i2c wires (on 20 and 21) the example continues and I get the cannot be found error. I've replaced wires, done everything I can think of. Again, it worked fine on the uno.

User avatar
Franklin97355
 
Posts: 23938
Joined: Mon Apr 21, 2008 2:33 pm

Re: Mega i2c pins not working

Post by Franklin97355 »

How are you connecting to 20 and 21 and did you remove the connections to A4 and A5?

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Mega i2c pins not working

Post by pburgess »

Can you test the components individually, with only one I2C device physically attached at a time? e.g. try just the matrix running one of the stock examples.

Also, tried swapping the wires to 20 & 21?

User avatar
adamr1
 
Posts: 120
Joined: Sun Jun 02, 2013 8:24 am

Re: Mega i2c pins not working

Post by adamr1 »

I have not tested seperatley but will try that. I did try swapping 20&21 with no luck and replaced the wires with no luck? Can the i2c bus go bad on its own? I've loaded different sketches and the board works otherwise.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”