I just realized that I left out an important bit of information: When the TWI "Start Failure" happens using the optimized (-O) code the program is accessing an EEPROM that does not exist. I would have expected the failure of the slave address send (repeated NACKs received). The reason the EEPROM does not exist is that it is mounted on an external board that may, or may not be present. The (repeated) NACK to the slave address is normally detected and interpreted as "EEPROM (and hence the external board) not present" and is a normal occurrence. From what I recall (I'll have to retest it) everything works (access to the TWI LED controller and the TWI EEPROM) when the EEPROM is present. The failure occurs when "-O" is used AND the EEPROM is not present ... Sorry, I should have included this before ... Cheers, Chuck Hackett "Good judgment comes from experience, experience comes from bad judgment" 7.5" gauge Union Pacific Northern (4-8-4) 844 http://www.whitetrout.net/Chuck
Message
RE: [AVR-Chat] TWI not working when optimization is on
2013-08-08 by Chuck Hackett
Attachments
- No local attachments were found for this message.