Go Down

Topic: I2C via other available Pins (Read 3 times) previous topic - next topic



I understand that the current "Wire" library sets Port C4 and Port C5 for I2C. Is there a way to set other ports as I2C comms? Thanks in advance!

Casey Gross

I dont think you can do that.

Professor Chaos

There are libraries that bit-bang I2C communication on other pins.  For example, the JeeLabs "Ports" library:  http://cafe.jeelabs.net/sw/library_-_ports/


I2C is hardwired into the AtMega168 and 328 to use those pins. See the pin mapping diagram http://arduino.cc/en/Hacking/PinMapping168 for the functions available from these chips to show how they map to the Arduino pin layout. Port C4 = AD4/SDA and Port C5 = AD5/SCL.

Jee Labs has done work on an Arduino variant and uses software I2C to extend the number of I2C capable pins here http://news.jeelabs.org/2010/03/15/software-and-hardware-i2c/ and I think this http://cafe.jeelabs.net/sw/library_-_ports/ is the library that allows the JeeNode to do this. Instructions are given for adding it to the Arduino IDE.


hi  Professor Chaos and capt.tagon,

Thanks alot! It's exactly what I'm looking for, bit-bang I2C.

Go Up