Go Down

Topic: Arduino I2C pin mapping for R3 (Read 1 time) previous topic - next topic

funkyguy4000

Hello,

I have a question regarding the pin mappings for the I2C pins.  I have the adafruit datalogger shield right here http://www.adafruit.com/products/243

It looks like the I2C bus lines are being pulled from the A4 and A5 pins on the arduino.  My question is, can I use this with the leonardo or the UNO R3?

are the I2C pins exclusively on the SDA and SCL pins for the R3 layout, or can I still pull the I2C pins from the A4 and A5?

Thanks!
Accelerate to 88 miles per hour.

wanderson

No, the 32U4 places the I2C pins on different physical pins.  Unless the shield can have those pins switched, it will not work with the Leonardo.

Of couse you could implement the I2C via bit bashing, and if you did that you could use any pins you wanted.
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

funkyguy4000

How about the UNO R3? 

that does the same thing right?
Accelerate to 88 miles per hour.

michael_x


How about the UNO R3? 

that does the same thing right?


Yes. Works fine for me.

wanderson

No that shield will work on the UNO, or earlier 328 based Arduino's.  It doesn't work on the Leonardo or Megas (not without modification)
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

funkyguy4000

So its jsut the 32U4 that is the issue. thank you!
Accelerate to 88 miles per hour.

retrolefty


So its jsut the 32U4 that is the issue. thank you!


No, it's what model main processor chip is being used that determines where the I2C pins are mapped to. The mega2560 and 1280 chips use different I2C pins then the 328p chip (and also the 32U4). The Arduino team has made a change to the shield pin layout on their newest boards (starting with the Leonardo board) to help solve this problem for future main boards and future shield boards by placing two new shield pins adjacent to the Aref pin so that the two I2C signals will be at a fixed location no matter what model main processor chip the board uses. That will not help present controller boards (except for the Leonardo) or present shield modules, but does give a 'fix' going forward.

Lefty

funkyguy4000

Okay, thanks for all the help!
My brother has already purchased the UNO R2 so I can't really help him. haha.
Accelerate to 88 miles per hour.

James C4S


The mega2560 and 1280 chips use different I2C pins then the 328p chip (and also the 32U4). The Arduino team has made a change to the shield pin layout on their newest boards (starting with the Leonardo board) to help solve this problem for future main boards and future shield boards by placing two new shield pins adjacent to the Aref pin so that the two I2C signals will be at a fixed location no matter what model main processor chip the board uses.


This change didn't start with the Leonardo.  The "R3" versions of the Mega and Uno started with  I2C pins next to AREF.  These pins are physically connected to the same pins as A4 and A5 on the Uno.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

retrolefty



The mega2560 and 1280 chips use different I2C pins then the 328p chip (and also the 32U4). The Arduino team has made a change to the shield pin layout on their newest boards (starting with the Leonardo board) to help solve this problem for future main boards and future shield boards by placing two new shield pins adjacent to the Aref pin so that the two I2C signals will be at a fixed location no matter what model main processor chip the board uses.


This change didn't start with the Leonardo.  The "R3" versions of the Mega and Uno started with  I2C pins next to AREF.  These pins are physically connected to the same pins as A4 and A5 on the Uno.


I stand corrected, newest Uno  and mega Rev boards support new added shield I2C pins.

Lefty

Go Up