260
CHAPTER 10 UART
10.9 UART Interrupt Occurrence and Flag Setting Timing

The UART has five flags and two interrupt causes.

The five flags are PE, ORE, FRE, RDRF, and TDRE.

One of the two interrupt causes is for data reception and the other is for data

transmission.

Interrupt Occurrence and Flags
PE indicates a parity error, ORE indicates an overrun, and FRE indic ates a frami ng erro r. Each
flag is set when the corresponding error occurs whil e d ata is rec eiv ed and is c le ared w hen "0" is
written to REC of the SCR register.
RDRF is set when received data is loaded to the SIDR register and is cleared when the data is
read from the SIDR register. Mode 1 does not s upport the parity chec k function, and m ode 2
does not support the parity check and framing error detectio n functions.
TDRE is set when the SODR register is emptied and ready to accept th e next ins tance of write
data and is cleared when the next data item is written to the SO DR register.
In data receptuion mode, PE, ORE, FRE, or RDRF is used to request an interrupt.
In data transmission, TDRE is used to request an interrupt.
Interrupt Flag Set Timing for Data Reception in Mode 0
When the last stop bit is detected after data recep tio n/tr an sfe r is com pl eted , t he PE, ORE, FRE,
and RDRF flags are set to issue an interrupt request to the CPU. If PE, ORE, or FRE is active,
the SIDR data is invalid.
Figure 10.9-1 ORE, FRE, and RDRF Set Timing (Mode 0)
D6 D7 Stop
PE, ORE, FRE
RDRF
Data
Reception interrupt