
eUSCI_B Operation – I
2
C Mode
Table 20-2. I
2
C State Change Interrupt Flags
Interrupt Flag
Interrupt Condition
UCALIFG
Arbitration lost interrupt. Arbitration can be lost when two or more transmitters start a transmission
simultaneously, or when the eUSCI_B operates as master but is addressed as a slave by another master in
the system. The UCALIFG flag is set when arbitration is lost. When UCALIFG is set, the UCMST bit is cleared
and the I
2
C controller becomes a slave.
UCNACKIFG
Not acknowledge interrupt. This flag is set when an acknowledge is expected but is not received.
UCNACKIFG is used in master mode only.
UCCLTOIFG
Clock low timeout. This interrupt flag is set, if the clock is held low longer than defined by the UCCLTO bits.
UCBIT9IFG
This interrupt flag is generated each time the eUSCI_B is transferring the nineth clock cycle of a byte of data.
This gives the user the ability to follow the I
2
C communication in software if wanted. UCBIT9IFG is not set for
address information.
UCBCNTIFG
Byte counter interrupt. This flag is set when the byte counter value reaches the value defined in UCBxTBCNT
and UCASTPx = 01 or 10. This bit allows to organize following communications, especially if a RESTART will
be issued.
UCSTTIFG
START condition detected interrupt. This flag is set when the I
2
C module detects a START condition together
with its own address
(1)
. UCSTTIFG is used in slave mode only.
UCSTPIFG
STOP condition detected interrupt. This flag is set when the I
2
C module detects a STOP condition on the bus.
UCSTPIFG is used in slave and master mode.
(1)
The address evaluation includes the address mask register if it is used.
20.3.11.5 UCBxIV, Interrupt Vector Generator
The eUSCI_B interrupt flags are prioritized and combined to source a single interrupt vector. The interrupt
vector register UCBxIV is used to determine which flag requested an interrupt. The highest-priority
enabled interrupt generates a number in the UCBxIV register that can be evaluated or added to the PC to
automatically enter the appropriate software routine. Disabled interrupts do not affect the UCBxIV value.
Read access of the UCBxIV register automatically resets the highest-pending interrupt flag. If another
interrupt flag is set, another interrupt is immediately generated after servicing the initial interrupt.
Write access of the UCBxIV register clears all pending Interrupt conditions and flags.
shows the recommended use of UCBxIV. The UCBxIV value is added to the PC to
automatically jump to the appropriate routine. The example is given for eUSCI0_B.
551
SLAU272C – May 2011 – Revised November 2013
Enhanced Universal Serial Communication Interface (eUSCI) – I
2
C Mode
Copyright © 2011–2013, Texas Instruments Incorporated