Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
asfarley
PostPosted: Feb 22, 2012 - 03:01 AM
Wannabe


Joined: Jan 25, 2009
Posts: 62


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?
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Feb 22, 2012 - 08:36 AM
10k+ Postman


Joined: Feb 12, 2005
Posts: 20667
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.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
asfarley
PostPosted: Feb 23, 2012 - 04:30 AM
Wannabe


Joined: Jan 25, 2009
Posts: 62


Thanks David, I got it working (Master mode) with the Fleury library as you described.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits