Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

RE: [AVR-Chat] TWI not working when optimization is on

2013-08-08 by Chuck Hackett

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

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.