BAT32G1x9 user manual | Chapter 19 Universal serial communication unit
691 / 1149
Rev.1.02
Figure 19-102 Flowchart of UART sending (continuous send mode).
UART communication starts
Configure transmit data
enable interrupt
write data into SDRmn[7:0](TxDq
regsiter, 8 bit) or SDRmn[8:0](9
bits)
wait transmission completes.
relevant initial configuration, refer to diagram 19-102
(select transmission completion interrupt)
configure transmission data and data count, clear communication
completion flag (via software, any configured internal RAM reserved
region, transmit data pointer, communication data count and
communication completion flag).
set to enable interrupt after clear interrupt
request flag(IFxx) and release interrupt
mask (MKxx).
start transmission via
writing into SDRmn[7:0]
if there is transmit data, then read transmit data
from storage region and write into TxDq, update
transmit data pointer and transmit data count. If
no data to transmit, then clear MDmn bit while
MDmn bit is '1'. Else,complete transmission.
SCI initial configuration
buffer empty/transmit completion
interrupt
communication data count >0
write data into SDRmn[7:0](TxDq
regsiter, 8 bit) or SDRmn[8:0](9
bits)
RETURN
transmission completes
?
disable interrupt (mask).
set STmn bit to 1.
communication completed.
write MDmn 0 bit to
0
Yes
No
No
Yes
m
a
in
p
ro
g
ra
m
in
te
rr
u
p
t
p
ro
ce
ss
p
ro
g
ra
m
m
a
in
p
ro
g
ra
m
from reserved region read and transmit data and
write to TxDq, update transmit data pointer
if transmission completion
interrupt occurs, jump to interrupt
process program.
communication data count-1
set communication completion flag
MDmn=1?
Yes
No
continue communicating?
write MDmn 0 bit to 1
check whether transmission completed via
confirming communication completion flag.
Note (1) to (6) in the figure corresponds to (
1) to (6) in
Figure 19-10119101 UART
Transmission (Continuous Send Mode)
"
.