Download Print this page

Renesas M16C/50 Series User Manual page 576

Advertisement

M16C/5L Group, M16C/56 Group
22.3.10.3 Master Reception
Master reception is described in this section. The initial settings described in 22.3.10.1 "Initial
Settings" are assumed to be completed. Figure 22.18 shows the operation example of master
reception. The following programs (A) to (D) are executed at (A) to (D) in Figure 22.18, respectively.
SCLMM
SDAMM
IR bit in the IICIC
register
Figure 22.18 Example of Master Reception
(A) Slave address transmission
(1) The BB bit in the S10 register must be 0 (bus free).
(2) Write E0h to the S10 register. (Start condition standby)
(3) Write a slave address to the upper 7 bits and a set the least significant bit (LSB) to 1. (Start
condition generated, then slave address transmitted)
(B) Data reception 1 (after slave address transmission)
2
(In I
C-bus interrupt routine)
(1) Write AFh to the S10 register. (Master receive mode)
(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 (data reception)
2
(In I
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) because the data is the last one.
(3) Write dummy data to the S00 register
(D) Completion of master reception
2
(In I
C-bus interrupt routine)
(1) Read the received data from the S00 register
(2) Write C0h to the S10 register. (Stop condition standby state)
(3) Write dummy data to the S00 register (stop condition generated)
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
S: Start condition
P: Stop condition
m
Slave address
S
R
(7 bits)
(A) Slave address transmission
A: ACK
R: Read
A: NACK
W: Write
s
m
Data
A
A
(8 bits)
Set to 0 by interrupt request acceptance or by program
(B) Data reception 1
(D) Completion of master reception
22. Multi-master I
m: Master outputs to SDA
s: Slave outputs to SDA
s
Data
A
(8 bits)
(C) Data reception 2
Stop condition
Page 539 of 803
2
C-bus Interface
m
P

Advertisement

loading