14.5.4 Acknowledge (ACK)
The serial data status of the sender and receiver can be confirmed by ACK. The receiver returns an
answer each time it receives 8 bits of data.
Usually, the sender receives a reply after sending 8-bit data. When the receiver returns an answer, it
considers that it has received normally and continues processing. bit2 (ACKDn) that can pass through IICA
status register n (IICSn). Confirm the detection of the response. When the master device receives the last data
in the received state, a stop condition is generated without returning a reply. When the slave device does not
return an answer after receiving data, the master device outputs a stop condition or a restart condition and
aborts the transmission. The reason for not returning an answer is as follows:
(1) There is no normal reception.
(2) The receipt of the last data has ended.
(3) There is no receiver specified at the address.
The receiver sets the SDAAn line low on the 9th clock to generate a response (normal reception).
By setting the bit2 (ACKEn) of the IICA control register n0 (IICCTLn0) to "1", it becomes a state that
automatically generates a response. Sets bit3 (TRCn) of the IICSn register by the 8th bit of data that follows
from the 7-bit address information. In the case of receiving (TRCn=0), it is usually necessary to set the ACKEn
bit to "1".
When the data cannot be received during the slave receive operation (TRCn=0) or the next data is not
required, the ACKEn bit must be cleared to 0 to inform the master controller that the data cannot be
received.
When the next data is not required during the master receive operation (TRCn=0), in order not to
generate a reply, the ACKEn bit must be cleared to 0 to notify the end of the slave sender's data (stop
sending).
Figure 14-17 ACK
SCLAn
SDAAn
When the address of the local station is received, it has nothing to do with the value of the ACKEn bit, and
a reply is automatically generated; When an address from a non-local station is received, no answer (NACK)
is generated.
When the extension code is received, an answer is generated by setting the ACKEn bit to 1 in advance.
The method of generating an answer when receiving data varies depending on the setting of the waiting time
series, as shown below.
When 8 clocks of wait are selected (bit3 (WTIMn) = 0 in the IICCTLn0 register): an answer is
generated synchronously with the 8th clock falling edge of the SCLAn pin by setting the ACKEn bit to "1"
before releasing the wait.
When selecting 9 clocks of waiting (bit3 (WTIMn) = 1 for the IICCTLn0 register): by placing beforehand
ACKEn position 1, generates an answer.
Remark n=0