eUSCI_A Operation – UART Mode
784
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode
30.3.15 eUSCI_A Interrupts in UART Mode
The eUSCI_A has only one interrupt vector that is shared for transmission and for reception.
30.3.15.1 UART Transmit Interrupt Operation
The UCTXIFG interrupt flag is set by the transmitter to indicate that UCAxTXBUF is ready to accept
another character. An interrupt request is generated if UCTXIE and GIE are also set. UCTXIFG is
automatically reset if a character is written to UCAxTXBUF.
UCTXIFG is set after a PUC or when UCSWRST = 1. UCTXIE is reset after a PUC or when
UCSWRST = 1.
30.3.15.2 UART Receive Interrupt Operation
The UCRXIFG interrupt flag is set each time a character is received and loaded into UCAxRXBUF. An
interrupt request is generated if UCRXIE and GIE are also set. UCRXIFG and UCRXIE are reset by a
system reset PUC signal or when UCSWRST = 1. UCRXIFG is automatically reset when UCAxRXBUF is
read.
Additional interrupt control features include:
•
When UCAxRXEIE = 0, erroneous characters do not set UCRXIFG.
•
When UCDORM = 1, nonaddress characters do not set UCRXIFG in multiprocessor modes. In plain
UART mode, no characters are set UCRXIFG.
•
When UCBRKIE = 1, a break condition sets the UCBRK bit and the UCRXIFG flag.
30.3.15.3 UART State Change Interrupt Operation
describes the UART state change interrupt flags.
Table 30-6. UART State Change Interrupt Flags
Interrupt Flag
Interrupt Condition
UCSTTIFG
START byte received interrupt. This flag is set when the UART module receives a START byte. This flag can
be cleared by writing 0 to it.
UCTXCPTIFG
Transmit complete interrupt. This flag is set after the complete UART byte in the internal shift register
including STOP bit is shifted out. This flag can be cleared by writing 0 to it.
30.3.15.4 UCAxIV, Interrupt Vector Generator
The eUSCI_A interrupt flags are prioritized and combined to source a single interrupt vector. The interrupt
vector register UCAxIV is used to determine which flag requested an interrupt. The highest-priority
enabled interrupt generates a number in the UCAxIV register that can be evaluated or added to the
program counter to automatically enter the appropriate software routine. Disabled interrupts do not affect
the UCAxIV value.
Read access of the UCAxIV register automatically resets the highest-pending Interrupt condition and flag.
Write access of the UCAxIV register clears all pending Interrupt conditions and flags. If another interrupt
flag is set, another interrupt is generated immediately after servicing the initial interrupt.
shows the recommended use of UCAxIV. The UCAxIV value is added to the PC to
automatically jump to the appropriate routine. The following example is given for eUSCI_A0.