BAT32G1x9 user manual | Chapter 19 Universal serial communication unit
703 / 1149
Rev.1.02
19.7.4
The processing step when an error occurs during UART (UART0~UART3) communication
The processing steps for errors that occur during UART (UART0~UART 3) communication are shown in
Figure 19-110andFigure 19-111.
Figure 19-110: The processing steps when a parity error or overflow error occurs
Software operation
Hardware status
remark
Read the serial data register mn
(SDRmn).
The BFFmn bit of the SSRmn register
is "0" and channel n is in the receivable
state.
This is to prevent an overflow error
from occurring at the end of the next
receive during error handling.
Read the serial status register mn
(SSRmn).
The error type is determined, and the
reading value is used to clear the error
flag.
Clear the trigger register mn to the
serial flag
(SDIRmn) write
"1".
Clears the error flag.
By writing the read value of the SSRmn
register directly to the SDIRmn register,
only errors during the read operation
can be cleared.
Figure 19-111: Processing steps when a frame error occurs
Software operation
Hardware status
remark
Read the serial data register mn
(SDRmn).
The BFFmn bit of the SSR mn
register is "0" and channel n is in a
receivable state.
This is to prevent overflow errors
from occurring at the end of the next
receive during mishandling.
Read the serial status register mn
(SSRmn).
The error class is judged, and the
reading value is used to remove the
error flag.
Write the serial flag to clear the trigger
register mn
(
SIRmn
)。
Clears the error flag.
By writing the read value of the
SSRmn register directly to the
SDIRmn register, only errors during
the read operation can be cleared.
Stop the serial channel register
m(STm). STmn position
"1".
The serial channel allows the SEm n
bit of the status register m(SEm) to be
"0" and the channel n Is the run
stopped state.
Synchronize processing with the
communicating party.
Because the start bit is offset, a frame
error can be considered. Therefore, it
is necessary to re-synchronize with
the communicating party and restart
communication.
Register the serial channel starting m
(SSm).
SSmn position "1".
The serial channel allows the SEm n
bit of the status register m(SEm) to be
"1" and channel n to be operational.
Note: m: Unit number (m=0~2)n: Channel number (n=0~3)mn=00~
03, 10
~
11, 20
~
21