
Rev. 1.20
150
November 20, 2019
Rev. 1.20
151
November 20, 2019
HT66F2740
12V High Current Flash MCU
HT66F2740
12V High Current Flash MCU
UART Interrupt Structure
Several individual UART conditions can trigger an USIM interrupt. When these conditions exist,
a low pulse will be generated to get the attention of the microcontroller. These conditions are a
transmitter data register empty, transmitter idle, receiver data available, receiver overrun, address
detect and an RX pin wake-up. When any of these conditions are created, if the global interrupt
enable bit and the USIM interrupt control bit are enabled and the stack is not full, the program will
jump to its corresponding interrupt vector where it can be serviced before returning to the main
program. Four of these conditions have the corresponding UUSR register flags which will generate
an USIM interrupt if its associated interrupt enable control bit in the UUCR2 register is set. The
two transmitter interrupt conditions have their own corresponding enable control bits, while the two
receiver interrupt conditions have a shared enable control bit. These enable bits can be used to mask
out individual USIM UART mode interrupt sources.
The address detect condition, which is also an USIM UART mode interrupt source, does not have an
associated flag, but will generate an USIM interrupt when an address detect condition occurs if its
function is enabled by setting the UADDEN bit in the UUCR2 register. An RX pin wake-up, which
is also an USIM UART mode interrupt source, does not have an associated flag, but will generate an
USIM interrupt if the UART clock (f
H
) source is switched off and the UWAKE and URIE bits in the
UUCR2 register are set when a falling edge on the RX pin occurs. Note that in the event of an RX
wake-up interrupt occurring, there will be a certain period of delay, commonly known as the System
Start-up Time, for the oscillator to restart and stabilize before the system resumes normal operation.
Note that the UUSR register flags are read only and cannot be cleared or set by the application
program, neither will they be cleared when the program jumps to the corresponding interrupt
servicing routine, as is the case for some of the other interrupts. The flags will be cleared
automatically when certain actions are taken by the UART, the details of which are given in the
UART register section. The overall UART interrupt can be disabled or enabled by the USIM
interrupt enable control bit in the interrupt control register of the microcontroller to decide whether
the interrupt requested by the UART module is masked out or allowed.
Transmitter Empty
Flag UTXIF
UUSR Register
Transmitter Idle
Flag UTIDLE
Receiver Overrun
Flag UOERR
Receiver Data
Available URXIF
UADDEN
UWAKE
0
1
0
1
URX7 if UBNO=0
URX8 if UBNO=1
UUCR2 Register
URIE
0
1
UTIIE
0
1
UTEIE 0
1
USIM Interrupt
Request Flag
USIMF
UUCR2 Register
USIME
EMI
0
1
Interrupt signal
to MCU
RX Pin
Wake-up
UART Interrupt Structure