When the TWI is configured as a client, it will wait for a Start condition to be detected. When this happens, the successive address packet will be received and checked by the address match logic. The client will ACK a correct address and store the address in the Client Data (TWIn.SDATA) register. If the received address is not a match, the client will not acknowledge or store the address but wait for a new Start condition.
The Address or Stop Interrupt Flag (APIF)
in the Client Status (TWIn.SSTATUS) register is set to ‘1
’ when a Start
condition is succeeded by one of the following:
0x00
and the Address (ADDR[0]) bit in the Client Address
(TWIn.SADDR) register are set to ‘1
’1
’ in the Client Address Mask
(TWIn.SADDRMASK) register1
’Depending on the Read/Write Direction (DIR) bit in the Client Status (TWIn.SSTATUS) register and the bus condition, one of four distinct cases (S1 to S4) arises after the reception of the address packet.