
eUSCI Operation – SPI Mode
19.3.8.2 SPI Receive Interrupt Operation
The UCRXIFG interrupt flag is set each time a character is received and loaded into UCxRXBUF. 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 UCxRXBUF is
read.
19.3.8.3 UCxIV, Interrupt Vector Generator
The eUSCI interrupt flags are prioritized and combined to source a single interrupt vector. The interrupt
vector register UCxIV is used to determine which flag requested an interrupt. The highest-priority enabled
interrupt generates a number in the UCxIV register that can be evaluated or added to the program counter
(PC) to automatically enter the appropriate software routine. Disabled interrupts do not affect the UCxIV
value.
Any access, read or write, of the UCxIV register automatically resets the highest-pending interrupt flag. If
another interrupt flag is set, another interrupt is immediately generated after servicing the initial interrupt.
19.3.8.3.1 UCxIV Software Example
The following software example shows the recommended use of UCxIV. The UCxIV value is added to the
PC to automatically jump to the appropriate routine. The following example is given for eUSCI_B0.
USCI_SPI_ISR
ADD
&UCB0IV, PC
; Add offset to jump table
RETI
; Vector 0: No interrupt
JMP
RXIFG_ISR
; Vector 2: RXIFG
TXIFG_ISR
; Vector 4: TXIFG
...
; Task starts here
RETI
; Return
RXIFG_ISR
; Vector 2
...
; Task starts here
RETI
; Return
513
SLAU272C – May 2011 – Revised November 2013
Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode
Copyright © 2011–2013, Texas Instruments Incorporated