RL78/G1P
CHAPTER 11 SERIAL ARRAY UNIT
R01UH0895EJ0100 Rev.1.00
443
Nov 29, 2019
Figure 11-107. Flowchart of UART Transmission (in Continuous Transmission Mode)
SAU default setting
Wait for transmit completes
Yes
No
Setting transmit data
For the initial setting, refer to Figure 11-101.
(Select buffer empty interrupt)
Enables interrupt
No
Yes
End of communication
RETI
No
Yes
No
Yes
M
a
in
r
outi
n
e
Inter
rupt pr
oc
es
si
ng r
o
u
ti
n
e
Ma
in
ro
u
tin
e
Starting UART
communication
<1>
<2>
<3>
<2>
<4>
<5>
<6>
Set data for transmission and the number of data. Clear communication end flag
(Storage area, Transmission data pointer, Number of communication data and
Communication end flag are optionally set on the internal RAM by the software).
Clear interrupt request flag (XXIF), reset interrupt mask (XXMK)
and set interrupt enable (EI).
Read transmit data from storage area and write it to TXDq.
Update transmit data pointer.
Communication starts by writing to
SDRmn [7:0].
When buffer empty/transfer end interrupt is
generated, it moves to interrupt processing
routine.
If transmit data is left, read them from
storage area then write into TxDq, and
update transmit data pointer and number of
transmit data.
If no more transmit data, clear MDmn0 bit if
it’s set. If not, finish.
MDmn0 = 1?
Sets communication
completion interrupt flag
Clear MDmn0 bit to 0
Check completion of transmission by
verifying transmit end flag
Writing transmit data to the SDRmn
[7:0] bits (TXDq register) (8 bits) or
the SDRmn [8:0] bits (9 bits)
Buffer empty/
transfer end interrupt
Number of
communication data > 0?
Writing transmit data to theSDRmn
[7:0] bits(TXDq register) (8 bits) or
the SDRmn [8:0] bits (9 bits)
Subtract -1 from number of
transmit data
Transmission completed?
Communication
continued?
Disable interrupt (MASK)
Write STmn bit to 1
Write MDmn0 bit to 1
Remark
<1> to <6> in the figure correspond to <1> to <6> in
Figure 11-106 Timing Chart of UART
Transmission (in Continuous Transmission Mode)
.