Go Down

Topic: i2c and a Dallas RTC Anyone?? (Read 3 times) previous topic - next topic

lucasvickers

So when using the Wire library you need to manually hook up a pull-up resistor.  I was playing around with the digital lines trying to use the internal pullup resistors and get the I2C communication going myself.  I could never even get the first ACK.

Why is the Wire library on the analog lines?  Is there something I am missing in regards to the complexity of communication over an I2C interface with arduino?

Do any of you know of any successful attempts at a wire type library using the digital lines?

Thanks!
Lucas

gazzy

I think to use I2C you have to use the analogue pins 4 and 5. if you look at the pin descriptions http://www.arduino.cc/en/Hacking/Atmega168Hardware you can see SCL and SDA are there. Maybe i'm wrong though and it is possible to use the digital pins.

lucasvickers

yes - found out those pins you get hardware support.
I'm going to attempt to code it all myself on the digital pins because I wanna learn!

Cheater

Quote
So when using the Wire library you need to manually hook up a pull-up resistor.  I was playing around with the digital lines trying to use the internal pullup resistors and get the I2C communication going myself.  I could never even get the first ACK.

Why is the Wire library on the analog lines?  Is there something I am missing in regards to the complexity of communication over an I2C interface with arduino?

I2C requires the external pull up resistors. Its not a Arduino thing.

I'd advise against trying to do I2C manually. Its not simple especially when compared with SPI.

I2C uses the analog pins because thats just where the required hardware is.
The analog pins are actually normal digital pins with analog functionality. Elsewhere on these forums explains how to use them as digital I/O.

lucasvickers

Arduino has internal pullup resistors!  not on those pins tho.  do they not work for I2C?

Go Up