Download Print this page

Renesas H8S Family Hardware Manual page 675

Advertisement

Receive Operation Using the Wait Function:
Figures 18.13 and 18.14 show the sample flowcharts for the operations in master receive mode
(WAIT = 1).
Figure 18.13 Sample Flowchart for Operations in Master Receive Mode
Master receive mode
Set TRS = 0 in ICCR
[1] Select receive mode.
Set ACKB = 0 in ICSR
Set HNDS = 0 in ICXR
Clear IRIC in ICCR
Set WAIT = 1 in ICMR
[2] Start receiving. The first read
Read ICDR
[3] Wait for a receive wait
Read IRIC in ICCR
No
IRIC = 1?
Yes
[4] Determine end of reception
No
IRTR = 1?
Yes
Yes
Last receive?
No
Read ICDR
[5] Read the receive data.
[6] Clear IRIC.
Clear IRIC in ICCR
Set ACKB = 1 in ICSR
[7] Set acknowledge data for the last reception.
[8] Wait for TRS setting
Wait for one clock pulse
[9] Set TRS for stop condition issuance
Set TRS = 1 in ICCR
[10] Read the receive data.
Read ICDR
[11] Clear IRIC.
Clear IRIC in ICCR
[12] Wait for a receive wait
Read IRIC in ICCR
No
IRIC=1?
Yes
[13] Determine end of reception
Yes
IRTR=1?
No
[14] Clear IRIC.
Clear IRIC in ICCR
[15] Clear wait mode.
Set WAIT = 0 in ICMR
Clear IRIC in ICCR
Read ICDR
[16] Read the last receive data.
Set BBSY= 0 and SCP= 0
[17] Generate stop condition
in ICCR
End
(receiving multiple bytes) (WAIT = 1)
Section 18 I
is a dummy read.
(Set IRIC at the fall of the 8th clock) or,
Wait for 1 byte to be received
(Set IRIC at the rise of the 9th clock)
(to end the wait insertion)
(Set IRIC at the fall of the 8th clock) or,
Wait for 1 byte to be received
(Set IRIC at the rise of the 9th clock)
(to end the wait insertion)
Clear IRIC.
( IRIC should be cleared to 0
after setting WAIT = 0.)
Rev. 1.00 Mar. 12, 2008 Page 627 of 1178
2
C Bus Interface (IIC)
REJ09B0403-0100

Advertisement

loading

This manual is also suitable for:

R4f2472R4f2462H8s/2462H8s/2400 seriesH8s/2472