Renesas H8S/2100 Series Hardware Manual page 550

6-bit single-chip microcomputer
Hide thumbs Also See for H8S/2100 Series:
Table of Contents

Advertisement

2
Section 17 I
C Bus Interface (IIC)
Figure 17.7 Sample Flowchart for Operations in Master Transmit Mode
Rev. 1.00 May 09, 2008 Page 524 of 954
REJ09B0462-0100
Start
Initialize IIC
Read BBSY flag in ICCR
No
BBSY = 0?
Yes
Set MST = 1 and
TRS = 1 in ICCR
Set BBSY =1 and
SCP = 0 in ICCR
Read IRIC flag in ICCR
No
IRIC = 1?
Yes
Write transmit data in ICDR
Clear IRIC flag in ICCR
Read IRIC flag in ICCR
No
IRIC = 1?
Yes
Read ACKB bit in ICSR
ACKB = 0?
Yes
Transmit mode?
Yes
Write transmit data in ICDR
Clear IRIC flag in ICCR
Read IRIC flag in ICCR
No
IRIC = 1?
Yes
Read ACKB bit in ICSR
No
End of transmission?
(ACKB = 1?)
Yes
Clear IRIC flag in ICCR
Set BBSY = 0 and
SCP = 0 in ICCR
End
[1] Initialization
[2] Test the status of the SCL and SDA lines.
[3] Select master transmit mode.
[4] Start condition issuance
[5] Wait for a start condition generation
[6] Set transmit data for the first byte
(slave address + R/W).
(After writing to ICDR, clear IRIC flag
continuously.)
[7] Wait for 1 byte to be transmitted.
[8] Test the acknowledge bit
transferred from the slave device.
No
No
Master receive mode
[9] Set transmit data for the second and
subsequent bytes.
(After writing to ICDR, clear IRIC flag
continuously.)
[10] Wait for 1 byte to be transmitted.
[11] Determine end of tranfer
[12] Stop condition issuance

Advertisement

Table of Contents
loading

This manual is also suitable for:

H8s/2112r

Table of Contents