R01UH0136EJ0210 Rev.2.10
Page 574 of 800
Jul 31, 2012
M16C/64A Group
25. Multi-master I
2
C-bus Interface
25.3.10.4 Slave Reception
The slave reception is described in this section. The initial settings described in 225.3.10.1 “Initial
Settings” are assumed to be completed. Figure 25.19 shows the example of slave reception. The
following programs (A) to (C) are executed at (A) to (C) in Figure 25.19, respectively.
Figure 25.19 Example of Slave Reception
(A) Slave receive is started.
(In I
2
C-bus interrupt routine)
(1) Check the value of the S10 register. When the TRX bit is 0, the I
2
C interface is in slave receive
mode.
(2) Write dummy data to the S00 register.
(B) Data reception 1
(In I
2
C-bus interrupt routine)
(1) Read the received data from the S00 register.
(2) Set the ACKBIT bit in the S20 register to 0 (ACK presents) because the data is not the last one.
(3) Write dummy data to the S00 register.
(C) Data reception 2
(In I
2
C-bus interrupt routine)
(1) Read the received data from the S00 register.
(2) Set the ACKBIT bit in the S20 register to 1 (no ACK presents) because the data is the last one.
(3) Write dummy data to the S00 register.
SCLMM
SDAMM
IR bit in the
IICIC register
(A) Start of slave reception
(C) Data reception 2
Completion of slave reception
Set to 0 by interrupt request acceptance or by program
m
s
m
s
s
m
m
Slave address
(7 bits)
W
S
A
Data
(8 bits)
A
Data
(8 bits)
A/A
P
S: Start condition
P: Stop condition
A: ACK
A: NACK
R: Read
W: Write
m: Master outputs to SDA
s: Slave outputs to SDA
(B) Data reception 1
Summary of Contents for M16C/60 Series
Page 853: ...M16C 64A Group R01UH0136EJ0210...