Use this: http://hubbard.engr.scu.edu/embedded/avr/doc/avr-libc/avr-libc-user-manual/twi_demo.html Just compile it with AVR GCC, and that's all. Take into account that this example is for devices like 24C04. If you use another device with different addressing then you will have to modify the source code. Check the documentation of mcp23016 and compare with 24C04's documentation. Regards Jose --- Lee Leathers <fredit@charter.net> escribió: > Hello, I am toying around with an mcp23016 (i2c port > expander) with my atmega 32. > > I have everything hooked up right.. but lack sample > code for hardware i2c (as I have heard this is very > diff from software i2c). > > Does anyone have any stripped down code (code just > to handle 1 device on the i2c) for the avr to be the > master on an i2c bus? > > > thanks-Lee ___________________________________________________________ 250MB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar
Message
Re: [AVR-Chat] Hardware i2c with atmega 32
2005-02-06 by Jose Fuentes
Attachments
- No local attachments were found for this message.