A TWI protocol question, please!
In The megaAVR-0 series Family Data Sheet, 40002015C.pdf, Section 18.104.22.168.2, "Transmitting Address Packets", the case of an address packet without an ACK is discussed. Since this can easily happen if the wrong address is used or if the addressed device is not connected to the bus, this seems like a pretty important case. The spec sheet says:
If no slave device responds to the address, the Master Write Interrupt Flag (WIF in TWIn.MSTATUS) and the Master Received Acknowledge Flag (RXACK in TWIn.MSTATUS) are set. The RXACK flag reflects the physical state of the ACK bit (i.e.< no slave did pull the ACK bit low). The clock hold is active at this point, preventing further activity on the bus.
However, there is no statement about appropriate actions. I could see having to change the bus state to allow further actions, or clearing the RXACK flag. I could also see issuing a STOP. Or, maybe just charge on with a new START with some other address? Or, maybe something entirely different?
So, you TWI users out there: what do you do?