128
MC96F8204
ABOV Semiconductor Co., Ltd.
11.8.9.2
UART Receiver Flag and Interrupt
The UART receiver has one flag that indicates the receiver state.
The receive complete (RXC) flag indicates whether there are unread data in the receive buffer. This flag is set when
there is unread data in the receive buffer and cleared when the receive buffer is empty. If the receiver is disabled
(RXE=0), the receiver buffer is flushed and the RXC flag is cleared.
When the receive complete interrupt enable (RXCIE) bit in the USTCR2 register is set and global interrupt is enabled,
the UART receiver complete interrupt is generated while RXC flag is set.
The UART receiver has three error flags which are frame error (FE), data overrun (DOR) and parity error (PE). These
error flags can be read from the USTST register. As received datas are stored in the 2-level receive buffer, these error
flags are also stored in the same position of receive buffer. So, before reading received data from USTDR register,
read the USTST register first which contains error flags.
The frame error (FE) flag indicates the state of the first stop bit. The FE flag is
‘0’ when the stop bit was correctly
detected as
“1”, and the FEn flag is “1” when the stop bit was incorrect, i.e. detected as “0”. This flag can be used for
detecting out-of-sync conditions between data frames.
The data overrun (DOR) flag indicates data loss due to a receive buffer full condition. DOR occurs when the receive
buffer is full, and another new data is presented in the receive shift register which are to be stored into the receive
buffer. After the DOR flag is set, all the incoming data are lost. To avoid data loss or clear this flag, read the receive
buffer.
The parity error (PE) flag indicates that the frame in the receive buffer had a parity error when received. If parity check
function is not enabled (USTP1=0), the PE bit is always read
“0”.
11.8.9.3
UART Parity Checker
If parity bit is enabled (USTP1=1), the Parity Checker calculates the parity of the data bits in incoming frame and
compares the result with the parity bit from the received serial frame.
11.8.9.4
UART Disabling Receiver
In contrast to transmitter, disabling the Receiver by clearing RXE bit makes the Receiver inactive immediately. When
the receiver is disabled, the receiver flushes the receive buffer, the remaining data in the buffer is all reset, and the
RXD pin can be used as a normal general purpose I/O (GPIO).
Содержание MC96F8104M
Страница 13: ...13 MC96F8204 ABOV Semiconductor Co Ltd 4 Package Diagram Figure 4 1 20 Pin SOP Package...
Страница 14: ...14 MC96F8204 ABOV Semiconductor Co Ltd Figure 4 2 20 Pin TSSOP Package...
Страница 15: ...15 MC96F8204 ABOV Semiconductor Co Ltd Figure 4 3 16 Pin SOPN Package...
Страница 16: ...16 MC96F8204 ABOV Semiconductor Co Ltd Figure 4 4 10 Pin SSOP Package...
Страница 17: ...17 MC96F8204 ABOV Semiconductor Co Ltd Figure 4 5 8 Pin SOP Package...