RL78/G13 CHAPTER 12 SERIAL ARRAY UNIT
R01UH0146EJ0100 Rev.1.00 604
Sep 22, 2011
Figure 12-49. Flowchart of Master Transmission/Reception (in Continuous Transmission/Reception Mode)
Settin
transmission/reception data
Readin
reception data to
SIOp (=SDRmn[7:0])
Write STmn bit to 1
For the initial setting, refer to Figure 12-43.
(Select buffer empty interrupt)
SAU default setting
o
o
End of communication
es
Yes
No
Continuing Communication?
es
Clear SAUmEN bit of the
PER0 register to 0
Number of
communication data?
Write MDmn0 bit to 1
BFFmn = 1?
<2>
<3>
<5>
<6>
<7>
<4>
<8>
<1>
Subtract -1 from number of
transmit data
Setting storage data and number of data for transmission/reception data
(Storage area, Transmission data pointer, Reception data, Number of
communication data and Communication end flag are optionally set on the
internal RAM by the software)
Clear MDmn0 bit to 0
Writin
dummy data to
SIOp (=SDRmn[7:0])
Writing transmit data to
SIOp (=SDRmn[7:0])
Except for initial interrupt, read data received then write them
to storage area, and update receive data pointer
If transmit data is left (number of communication data is
equal or grater than 2), read them from storage area then
write into SIOp, and update transmit data pointer.
If it’s waiting for the last data to receive (number of
communication data is equal to 1), change interrupt timing
to communication end
RETI
Number of communication
data
= 0?
Starting setting
When transmission/reception interrupt is generated, i
moves to interrupt processing routine
Buffer empty/transfer end interrupt
Wait for transmission/reception
completes
≥ 2
= 0
= 1
Enables interrupt
Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set interrupt
enable (EI)
Disable interrupt (MASK)
Writing to SIOp makes SOp
and SCKp signals out
(communication starts)
Read transmit data from storage area and write it
to SIOp. Update transmit data pointer.
Main routine Main routine Interrupt processing routine
Remark <1> to <8> in the figure correspond to <1> to <8> in Figure 12-48 Timing Chart of Master
Transmission/Reception (in Continuous Transmission/Reception Mode).
<R>