Rev. 1.10
172
October 23, 2020
Rev. 1.10
173
October 23, 2020
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
UART Interrupt Structure
Several individual UART conditions can generate a UART 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 its corresponding 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 USR register flags which will
generate a UART interrupt if its associated interrupt enable control bit in the UCR2 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 UART interrupt sources.
The address detect condition, which is also a UART interrupt source, does not have an associated
flag, but will generate a UART interrupt when an address detect condition occurs if its function is
enabled by setting the ADDEN bit in the UCR2 register. An RX pin wake-up, which is also a UART
interrupt source, does not have an associated flag, but will generate a UART interrupt if the UART
clock (f
H
) source is switched off and the WAKE and RIE bits in the UCR2 register are set when a
falling edge on the RX pin occurs.
Note that the USR 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 related
interrupt enable control bits in the interrupt control registers of the microcontroller to decide whether
the interrupt requested by the UART module is masked out or allowed.
Transmitter Empty
Flag TXIF
USR Register
Transmitter Idle
Flag TIDLE
Receiver Overrun
Flag OERR
Receiver Data
Available RXIF
ADDEN
RX Pin
Wake-up
WAKE
0
1
0
1
TXRX7 if BNO=0
RX8 if BNO=1
UCR2 Register
RIE
0
1
TIIE
0
1
TEIE
0
1
UART Interrupt
Request Flag
URF
UCR2 Register
URE
EMI
0
1
Interrupt signal
to MCU
UART Interrupt Structure