
Rev. 1.20
148
November 20, 2019
Rev. 1.20
149
November 20, 2019
HT66F2740
12V High Current Flash MCU
HT66F2740
12V High Current Flash MCU
Receiver Interrupt
The read only receive interrupt flag URXIF in the UUSR register is set by an edge generated by the
receiver. An interrupt is generated if URIE=1, when a word is transferred from the Receive Shift
Register, RSR, to the Receive Data Register, UTXR_RXR. An overrun error can also generate an
interrupt if URIE=1.
Managing Receiver Errors
Several types of reception errors can occur within the UART module, the following section describes
the various types and how they are managed by the UART.
Overrun Error – UOERR
The UTXR_RXR register is composed of a two byte deep FIFO data buffer, where two bytes can be
held in the FIFO register, while a third byte can continue to be received. Before this third byte has
been entirely shifted in, the data should be read from the UTXR_RXR register. If this is not done,
the overrun error flag UOERR will be consequently indicated.
In the event of an overrun error occurring, the following will happen:
•
The UOERR flag in the UUSR register will be set.
• The UTXR_RXR contents will not be lost.
• The shift register will be overwritten.
• An interrupt will be generated if the URIE bit is set.
The UOERR flag can be cleared by an access to the UUSR register followed by a read to the
UTXR_RXR register.
Noise Error – UNF
Over-sampling is used for data recovery to identify valid incoming data and noise. If noise is
detected within a frame the following will occur:
•
The read only noise flag, UNF, in the UUSR register will be set on the rising edge of the URXIF bit.
• Data will be transferred from the Shift register to the UTXR_RXR register.
• No interrupt will be generated. However this bit rises at the same time as the URXIF bit which
itself generates an interrupt.
Note that the UNF flag is reset by a UUSR register read operation followed by a UTXR_RXR
register read operation.
Framing Error – UFERR
The read only framing error flag, UFERR, in the UUSR register, is set if a zero is detected instead of
stop bits. If two stop bits are selected, both stop bits must be high; otherwise the UFERR flag will be
set. The UFERR flag and the received data will be recorded in the UUSR and UTXR_RXR registers
respectively, and the flag is cleared in any reset.
Parity Error – UPERR
The read only parity error flag, UPERR, in the UUSR register, is set if the parity of the received
word is incorrect. This error flag is only applicable if the parity is enabled, UPREN=1, and if
the parity type, odd or even is selected. The read only UPERR flag and the received data will be
recorded in the UUSR and UTXR_RXR registers respectively. It is cleared on any reset, it should
be noted that the flags, UFERR and UPERR, in the UUSR register should first be read by the
application program before reading the data word.