Exceptions and Interrupts Control
115
SPRUH22I – April 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
System Control and Interrupts
NOTE:
1.
To clear a CPU IFR bit, you must write a zero to it, not a one.
2.
When a maskable interrupt is acknowledged, only the IFR bit is cleared automatically.
The flag bit in the corresponding peripheral control register is not cleared. If an
application requires that the control register flag be cleared, the bit must be cleared by
software.
3.
When an interrupt is requested by an INTR instruction and the corresponding IFR bit is
set, the CPU does not clear the bit automatically. If an application requires that the IFR
bit be cleared, the bit must be cleared by software.
4.
IMR and IFR registers pertain to core-level interrupts. All peripherals have their own
interrupt mask and flag bits in their respective control/configuration registers. Note that
several peripheral interrupts are grouped under one core-level interrupt.
1.5.4.4.2 Interrupt Enable Register (IER) and Debug Interrupt Enable Register (DBGIER)
The IER 16-bit CPU register contains enable bits for all the maskable CPU interrupt levels (INT1-INT14,
RTOSINT and DLOGINT). Neither NMI nor XRS is included in the IER; thus, IER has no effect on these
interrupts.
You can read the IER to identify enabled or disabled interrupt levels, and you can write to the IER to
enable or disable interrupt levels. To enable an interrupt level, set its corresponding IER bit to one using
the OR IER instruction. To disable an interrupt level, set its corresponding IER bit to zero using the AND
IER instruction. When an interrupt is disabled, it is not acknowledged, regardless of the value of the INTM
bit. When an interrupt is enabled, it is acknowledged if the corresponding IFR bit is one and the INTM bit
is zero.
When using the OR IER and AND IER instructions to modify IER bits make sure they do not modify the
state of bit 15 (RTOSINT) unless a real-time operating system is present.
When a hardware interrupt is serviced or an INTR instruction is executed, the corresponding IER bit is
cleared automatically. When an interrupt is requested by the TRAP instruction the IER bit is not cleared
automatically. In the case of the TRAP instruction if the bit needs to be cleared it must be done by the
interrupt service routine.
At reset, all the IER bits are cleared to 0, disabling all maskable CPU level interrupts.
The Debug Interrupt Enable Register (DBGIER) is used only when the CPU is halted in real-time
emulation mode. An interrupt enabled in the DBGIER is defined as a time-critical interrupt. When the CPU
is halted in real-time mode, the only interrupts that are serviced are time-critical interrupts that are also
enabled in the IER. If the CPU is running in real-time emulation mode, the standard interrupt-handling
process is used and the DBGIER is ignored.
As with the IER, you can read the DBGIER to identify enabled or disabled interrupts and write to the
DBGIER to enable or disable interrupts. To enable an interrupt, set its corresponding bit to 1. To disable
an interrupt, set its corresponding bit to 0. Use the PUSH DBGIER instruction to read from the DBGIER
and POP DBGIER to write to the DBGIER register. At reset, all the DBGIER bits are set to 0.
1.5.4.5
External Interrupt Control Registers
Three external interrupts, XINT1 - XINT3 are supported. Each of these external interrupts can be selected
for negative or positive edge triggering and can also be enabled or disabled. The masked interrupts also
contain a 16-bit free running up counter that is reset to zero when a valid interrupt edge is detected. This
counter can be used to accurately time stamp the interrupt.
For XINT1/XINT2/XINT3, there is also a 16-bit counter that is reset to 0x000 whenever an interrupt edge is
detected. These counters can be used to accurately time stamp an occurrence of the interrupt.