BAT32G1x9 user manual | Chapter 19 Universal serial communication unit
698 / 1149
Rev.1.02
Figure 19-108 Flowchart of UART reception
UART communication starts
configure receiving data
enable interrupt
wait till receiving ends
relevant initial configuration, refer to diagram
19-110
(select transmission completion interrupt)
configure reciving data storage region and communication data
count (via software, any configured internal RAM storage
region, receiving data pointer and communication data count).
set to enable interrupt after clear interrupt
request flag(IFxx) and release interrupt
mask (MKxx).
start receiving via detecting start
bit.
read received data and write into storage region,
incremental counting of received data count,
update received data pointer.
SCI initial configuration
transmission completion interrupt
normal reception?
write transmit data to SDRmn[7:0]
(TXDq register, 8 bits) or
SDRmn[8:0] register (9 bits).
RETURN
receiving completed?
disable interrupt (mask).
write STmn bit to 1.
communication completed.
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
generate interrupt while receiving
completes.
confirm receiving data count, judge whether
receiving completes.
error handling
Yes