Colin O'Flynn wrote:
Hey,

If the I2C device wasn't responding, would your program freeze up as you describe? It could be that the I2C device is in reset still when the AVR is trying to talk to it...

 -Colin

However, with I2C, the program runs as soon as I download the program, but
if I turn off the 5v and turn it back on again, the program won't run at
all.

I just had what may be a similar problem. As far as I could tell, sometimes when the system started up, the slave I2C device thought it was in the middle of a transaction and it would hold the bus in an active state.

I solved it by:
- at startup, configure the I2C clock line as a regular output port
- toggle the clock line several times to flush the slave device
- configure the I2C port correctly

John


_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to