Example Of Slave Receive - Renesas M16C FAMILY series Hardware Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C FAMILY series:
Table of Contents

Advertisement

M
1
6
C
2 /
8
G
o r
u
p
(
M
1
6
C

16.13.2 Example of Slave Receive

For example, a slave receives data as shown below when following conditions are met: high-speed clock
mode, SCL frequency of 400 kHz, ACK clock added and addressing format.
1) Set a slave address in the 7 high-order bits in the S0D0 register
2) Set "A5
" to the S20 register, "000
16
S3D0 register to generate an ACK clock and set SCL clock frequency at 400kHz (f
3) Set "00
" to the S10 register to reset transmit/receive mode
16
4) Set "08
" to the S1D0 register to enable data communication
16
5) When a START condition is received, addresses are compared
6) •When the transmitted addresses are all "0" (general call), the ADR0 bit in the S10 register is set to "1"
2
and an I
C bus interface interrupt request signal is generated.
•When the transmitted addresses match with the address set in 1), the ASS bit in the S10 register
is set to "1" and an I
•In other cases, the ADR0 and AAS bits are set to "0" and I
is not generated.
7) Write dummy data to the S00 register.
8) After receiving 1-byte data, an ACK-CLK bit is automatically returned and an I
interrupt request signal is generated.
9) To determine whether the ACK should be returned depending on contents in the received data, set
dummy data to the S00 register to receive data after setting the WIT bit in te S3D0 register to "1"
(enable the I
interrupt is generated when the 1-byte data is received, set the ACKBIT bit to "1" or "0" to output a
signal from the ACKBIT bit.
10) When receiving more than 1-byte control data, repeat steps 7) and 8) or 7) and 9).
11) When a STOP condition is detected, the communication is ended.
R
e
. v
2
0 .
0
J
a
. n
3
, 1
2
0
0
7
R
E
J
0
9
B
0
0
4
7
0 -
2
0
0
2 /
, 8
M
1
6
C
2 /
8
) B
2
2
C bus interface interrupt request signal is generated.
2
C bus interface interrupt of data receive completion). Because the I
page 278
f o
3
8
5
16. MULTI-MASTER I
" to the ICK4 to ICK2 bits in the S4D0 register, and "00
2
2
C bus INTERFACE
C bus interface interrupt request signal
2
C bus interface
2
" to the
16
=8MHz)
1
C bus interface

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tiny seriesM16c series

Table of Contents