Chapter 1 Hardware Structure
UART Interrupt Scheme
The UART internal function possesses its own internal interrupt and independent interrupt vector.
Several individual UART conditions can generate an internal UART interrupt. 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 UART in-
terrupt is enabled and the stack is not full, the program will jump to the UART interrupt vector
where it can be serviced before returning to the main program. Four of these conditions, have a
corresponding USR register flag, which will generate a UART interrupt if its associated interrupt en-
able flag in the UCR2 register is set. The two transmitter interrupt conditions have their own corre-
sponding enable bits, while the two receiver interrupt conditions have a shared enable 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
microcontroller is woken up by a low going edge on the RX pin, if the WAKE and RIE bits in the
UCR2 register are set. Note that in the event of an RX wake-up interrupt occurring, there will be a
delay of 1024 system clock cycles before the system resumes normal operation.
U S R R e g is te r
T r a n s m itte r E m p ty
F la g T X IF
U C R 2 R e g is te r
T E IE
1
0
IN T C 1
R e g is te r
0
1
R IE
1
0
U A R T In te rru p t
R e q u e s t F la g
U R F
E U R I
IN T C 0
R e g is te r
E M I
T r a n s m itte r Id le
F la g T ID L E
T IIE
R e c e iv e r O v e r r u n
F la g O E R R
O R
R e c e iv e r D a ta
A v a ila b le R X IF
A D D E N
1
0
0
1
R X P in
W a k e -u p
W A K E
1
0
R X 7 if B N O = 0
R X 8 if B N O = 1
U C R 2 R e g is te r
UART Interrupt Scheme
Note that the USR register flags are read only and cannot be cleared or set by the application pro-
gram, neither will they be cleared when the program jumps to the corresponding interrupt servic-
ing 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 EURI bit in the INTC1 inter-
rupt control register to prevent a UART interrupt from occurring.
99
Home Index Bookmark Pages Text
Previous Next
Pages: Home Index