General Flowchart; Fig. 5.5.4 Flowchart Of Write Processing Routine - Renesas 7200 Series User Manual

Mitsubishi 8-bit single-chip microcomputer
Table of Contents

Advertisement

APPLICATION
5.5 Example of I
2
C-BUS control by software (M37220M3-XXXSP/FP)

5.5.4 General flowchart

(1) Write processing routine
The processing routine which controls I
the read processing routine. The START condition, the STOP condition and the data output processing
routine are used as the common processing routine.
STOP condition
"NO ACK COUNTER"
←"NO ACK COUNTER" + 1
"NO ACK COUNTER"
≥ "3"?
No (try 3 times)

Fig. 5.5.4 Flowchart of write processing routine

5-28
A
Slave address
C
S
(W) "BA
"
16
K
Write start
"WRITEDATA"
←Slave address (W) "BA
"WRITE DATA COUNTER"
= "1" (number of write bytes)
"NO ACK COUNTER" = "0"
START condition
Data output
No (no ACK)
"F_ACK" = "0"?
"WRITEDATA" ←Sub-address
Data output
No (no ACK)
"F_ACK" = "0"?
"WRITE DATA
COUNTER" = "0"?
Yes (end)
Yes (give up)
STOP condition
7220 Group User's Manual
2
C-BUS devices branch to the write processing routine and
A
Sub-address
C
Data
K
RAM:
Flag:
"
16
Yes (ACK)
Yes (ACK)
No (not yet)
Bus H
"WRITE DATA COUNTER"
End
←"WRITE DATA COUNTER" – 1
A
C
P
K
WRITEDATA
NO ACK COUNTER
WRITE DATA COUNTER
F_ACK
"WRITEDATA" ←Write data
Data output

Advertisement

Table of Contents
loading

This manual is also suitable for:

7220

Table of Contents