avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-chat] I2C controller: INT flag a bit leaves me confused !


From: Vincent Trouilliez
Subject: [avr-chat] I2C controller: INT flag a bit leaves me confused !
Date: Tue, 3 Mar 2009 02:03:41 +0100

Hi,

Trying to use the I2C controller on my mega32.

Finished reading the datasheet and had a look at the avr-libc example
code.

I am confused as to how the TWINT flag works !

I mean, you have to set it to logic one to start an action on the bus,
and then the code examples wait for that flag to be a logic one which
means the requested action has been performed.
Huuu... if I set a bit to one and then next instruction checks if it's
one... how has the flag any chance to drop to zero so it can go back up
to one ?
If it stays at one once we have set it, then we are not waiting at all
so it doens't work... what am I missing ?! I am confused (euphemism) !

I could imagine that the write operation to this bit triggers the
requested action but does not actually set physically the bit to one,
so when we read it back on the next instruction cycle, we don't
actually see the "one" that we just wrote.

I would not mind someone confirming this scenario or telling me
otherwise if need be, please ! ;-)


Regards,

--
Vince




reply via email to

[Prev in Thread] Current Thread [Next in Thread]