From http://arduino.cc/forum/index.php/topic,53131.0.html:
"Hello..
there is a bug in twi.c which effectively disconnects TWI/I²C after an error
in Slave Receiver mode.
The bug is in SIGNAL(TWI_vect) at case label
TW_SR_DATA_NACK/TW_SR_GCALL_DATA_NACK
the wrong code is:
// nack back at master
twi_reply(0);
This should be:
twi_reply(1);
Explanation: See ATmegaxxx Documentation (doc8161.pdf) from Atmel. In Fig.
21-16 on page 236 the states $88 (TW_SR_DATA_NACK) and $98
(TW_SR_GCALL_DATA_NACK) are final states. There is nothing to "nack back at
master". This has already been done! Unlike the $80 (TW_SR_DATA_ACK) and $90
(TW_SR_GCALL_DATA_ACK) states, there will be no $A0 state (TW_SR_STOP) to
terminate. Table 21-4. on page 235 shows that if we now leave TWEA off, we will
never be able again to be selected as receiver. Calling twi_reply(1) will set
TWEA and thus allow further selection as slave."
Original issue reported on code.google.com by dmel...@gmail.com on 26 Feb 2011 at 8:06
Original issue reported on code.google.com by
dmel...@gmail.com
on 26 Feb 2011 at 8:06