
Interrupts
7-22
These interrupts are prioritized by the selection of one over the other if both
come on the same clock cycle (IIOF0 the highest, IIOF1 next, etc.). When an
interrupt is taken, the status register ST(GIE) bit is reset to 0, disabling any oth-
er incoming interrupt (except NMI). This prevents any other interrupt
(IIOF0–IIOF3) from assuming program control until the ST(GIE) bit is set back
to 1. In addition, the ST(GIE) bit is saved into ST(PGIE) and the ST(CF) bit into
ST(PCF). On a return from an interrupt routine, the RETI and RETIcond
instructions place the value that is in the ST(PGIE) bit into the ST(GIE) bit and
ST(PCF) bit into the ST(CF) bit, returning them to their previous values.
External interrupts can be either edge- or level-triggered depending on how
the TYPE fields are set in the IIF register (see subsection 3.1.10, IIOF Flag
Register (IIF) on page 3-13, for more information about the IIF).
For an edge-triggered interrupt to be detected by the ’C4x, the external pin
must transition from 1 to 0. And then, it needs to be held low for at least one
H1/H3 cycle (but it could be held low longer).
For a level-triggered interrupt to be detected by the ’C4x, the external pin
needs to be held low for between one and two cycles (1
2). If the interrupt is held low for more than two cycles, more than one interrupt
might be recognized. There is no need to provide an edge in this case.
low-pulse width
Note:
Level-triggered interrupts are unlatched. The ’C4x will only detect them if the
low-level is present during a fetch-to-decode pipeline transition. This means
that during a pipeline halt, the level-triggered interrupts might be missed
even if they are held low between one and two cycles. This is not the case
for an edge-triggered interrupt because they are latched (they will get recog-
nized regardless if the pipeline is halted).
NMI
The
nonmaskable interrupt, NMI (an incoming low on pin AJ5, signal NMI), is
not masked by the ST(GIE) bit. Even though the NMI is nonmaskable, its pro-
cessing is temporarily postponed during delayed branches and multicycle
CPU operations. NMI is a negative-going, edge-triggered, latched interrupt.
Take special care when using an NMI as a second level interrupt. When the
’C4x services an interrupt, interrupts are disabled except for the NMI. This
creates a problem because the ST register may end up with the wrong value
if the NMI is executed before the first level ISR that preserves the ST register’s
value.
The TMS320C44 and the TMS320C40 (revision 5.0 and greater) has a soft-
ware-configurable feature that allows the forcing ready of the internal peripher-