
ML674001 Seies/ML675001 Series User’s Manual
Chapter 20
I2C
20-15
20.3.4
Receive operation (transfer of 2 byte or more from slave to master, in 7-bit address mode)
Repeat step
from section 20.3.2
The I2CCON register is set to XXX0X110.
The following series of operations is automatically performed
when the STCM bit (bit 2 of the I2CCON register) is set to "1": Transmission of the start sequence,
transmission of the slave address and the transfer direction specified to the I2CSAD register, confirmation of
an acknowledge from the slave device for the address transmitted, storage of 8-bit data transmitted from the
slave device into the I2CDR register, and transmission of an acknowledge for the data received.
Here,
because the I2COC bit (bit 1 of the I2CCON register) is set to "1," the stop sequence will not be transmitted
(the bus remains busy) and the command wait state is activated.
At this point, the I2CIR bit is set to "1,"
indicating that the reception of 1-byte of data has been finished.
The data received can be retrieved by
reading the I2CDR register.
If an acknowledge for the address transmitted has not been returned normally,
the I2CAAK bit is set to "1" upon completion of reception.
Multiple bytes are received by repeating step
the required number of times.
To receive the last byte after multiple bytes have been received, step
. Next, an acknowledge is transmitted
for the data received, the stop sequence is transmitted (the bus is released) after the last byte is received, and
reception is then finished.
I2CDR=
Read_data
1-byte reception
complete
Waits for
I2CCON setting
Interrupt
Register
settings
Reception
complete
I2CDR
I2CSAD = xxxxxxx1b
I2CCON = xxx0x110b
1-byte reception
complete
Waits for
I2CCON setting
I2CDR=Read_data
I2CCON = xxx00110b
I2CDR = Read_data
I2CCON = xxx01100b
I2CDR
I2CSAD
S B
7
B
6
B
5
B
4
B
3
B
2
B
1
A B
7
B
6
B
5
B
4
B
3
B
2
B
1
B
0
A B
7
B
6
B
5
B
4
B
3
B
2
B
1
B
0
A B
7
B
6
B
5
B
4
B
3
B
2
B
1
B
0
A P
Output
S
P
S
r
A
Input
Start
sequence
Stop
sequence
Restart
sequence
Acknowledge
received
Negative
acknowledge
received
Acknowledge
transmitted
Negative
acknowledge
transmitted