Digital I/O Operation
680
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Digital I/O
•
Bit = 1: An interrupt is pending
Only transitions, not static levels, cause interrupts. If any PxIFG flag becomes set during a Px interrupt
service routine or after Px interrupt service routine execution is completed, the set PxIFG flag generates
another interrupt. This ensures that each transition is acknowledged.
NOTE:
PxIFG flags when changing PxOUT, PxDIR, or PxREN
Writing to PxOUT, PxDIR, or PxREN can result in setting the corresponding PxIFG flags.
Any access (read or write) of the PxIV register automatically resets the highest pending interrupt flag. If
another interrupt flag is set, another interrupt is immediately generated after servicing the initial interrupt.
For example, assume that P1IFG.0 has the highest priority. If the P1IFG.0 and P1IFG.2 flags are set when
the interrupt service routine accesses the P1IV register, P1IFG.0 is reset automatically. After the
completion of P1IFG.0 interrupt service routine, the P1IFG.2 generates another interrupt.
12.2.7.1 Interrupt Edge Select Registers (PxIES)
Each PxIES bit selects the interrupt edge for the corresponding I/O pin.
•
Bit = 0: Respective PxIFG flag is set on a low-to-high transition
•
Bit = 1: Respective PxIFG flag is set on a high-to-low transition
NOTE:
Writing to PxIES
Writing to PxIES for each corresponding I/O can result in setting the corresponding interrupt
flags.
PxIES
PxIN
PxIFG
0
→
1
0
May be set
0
→
1
1
Unchanged
1
→
0
0
Unchanged
1
→
0
1
May be set
12.2.7.2 Interrupt Enable Registers (PxIE)
Each PxIE bit enables the associated PxIFG interrupt flag.
•
Bit = 0: The interrupt is disabled
•
Bit = 1: The interrupt is enabled
NOTE:
When the device operates in any power mode other than low-power modes LPM3, LPM4,
and LPMx.5, the interrupt capability is available only when the PxSEL1 and PxSEL0 bits are
0 for the corresponding interrupt capable I/Os. The PxIE and PxIES registers need to be
programmed appropriately.
When the device operates in any of the low-power modes LPM3, LPM4, or LPMx.5, the
wake-up capability is available for PxSEL1, PxSEL0 bit combinations 00, 01, and 10 of the
corresponding wake-up capable I/Os. The PxIE register needs to be programmed
appropriately for wake-up. The PxIES register configuration is a don't care and wake-up is
triggered upon rising or falling edge of the wake-up event.