Specifications

RX62N Group, RX621 Group RIIC Multi-Master Communication
R01AN0630EJ0100 Rev.1.00 Page 4 of 23
Sep 27, 2011
3. Software Description
3.1 Operation Overview
The program performs master mode transmission. If the arbitration lost state is detected during master mode
transmission, the communication of the other master device is given priority and the program switches to slave
mode operation.
The program performs master mode reception. If the arbitration lost state is detected during master mode reception,
the communication of the other master device is given priority and the program switches to slave mode operation.
If the slave address matches during slave mode operation, a slave reception or transmission operation is started
according to the state of the R/W# bit.
A callback function is called when slave mode communication completes or when master mode communication
completes.
Table 3 lists the settings for the RIIC module used in this application note.
Table 3 RIIC Settings
Item Description
Channel Channel 0
Master/slave operation Master transmission, master reception, slave reception, slave transmission
Address format 7-bit address format
Slave address 0x10
Transmission speed 100 kbps
Arbitration lost detection Master arbitration lost detection
Timeout detection
Count when the SCL line is low or high
Long mode (16-bit counter)
Note: Refer to the RX62N Group and RX621 Group Hardware Manual and the I²C bus specifications for
details on the I
2
C bus communication format.
3.2 File Structure
Table 4 lists the files used for the sample code. The files automatically generated by the integrated development
environment are not listed.
Table 4 File Structure
File Name Function Notes
main.c Main processing
riic.c RIIC control related processing
riic_int.c RIIC interrupt processing
riic.h RIIC related header files
intprg.c File automatically generated by HEW
(Only the RIIC interrupt functions used in this program are deleted.)