eUSCI_B Operation – I
2
C Mode
976
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Enhanced Universal Serial Communication Interface (eUSCI) – I
2
C Mode
(1)
The address evaluation includes the address mask register if it is used.
Table 26-2. I
2
C State Change Interrupt Flags
Interrupt Flag
Interrupt Condition
UCALIFG
Arbitration-lost. 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 time-out. 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 9th clock cycle of a byte of data. This
gives the user the possibility to follow the I
2
C communication in software if wanted. The 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.
26.3.10.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.