 |
| Author |
Message |
|
|
Posted: Feb 22, 2012 - 03:01 AM |
|

Joined: Jan 25, 2009
Posts: 53
|
|
Hi,
I'm looking for an i2c library for the Atmega325a for AVR-GCC (WinAVR).
I've searched and found a library for the Atmega168 and the IAC compiler but I got some errors even after updating the includes for <avr/io.h>.
What's the normal route for including i2c? Is there a library with no changes required for the Atmega325a? Am I missing an easy step to modify the existing library? |
|
|
| |
|
|
|
|
|
Posted: Feb 22, 2012 - 08:36 AM |
|

Joined: Feb 12, 2005
Posts: 16320
Location: Wormshill, England
|
|
Are you are an I2C Master i.e. you just want to read write to some I2Cslave chips like DS1307 or 24Cxxx?
Or do you want to be a Slave? This is difficult!
Since your ATmega325 does not have hardware TWI, download the Fleury I2C library and use the bit-banged i2c_master.S
Quite honestly, the USI is more trouble than it is worth.
David. |
|
|
| |
|
|
|
|
|
Posted: Feb 23, 2012 - 04:30 AM |
|

Joined: Jan 25, 2009
Posts: 53
|
|
| Thanks David, I got it working (Master mode) with the Fleury library as you described. |
|
|
| |
|
|
|
|
|
|
|