ST7LUS5, ST7LU05, ST7LU09
7
Interrupts
Interrupts
The ST7 core may be interrupted by one of two different methods: Maskable hardware
interrupts as listed in Table 15: Interrupt mapping on page 46 and a non-maskable software
interrupt (TRAP). The interrupt processing flowchart is shown in Figure 18.
The maskable interrupts must be enabled by clearing the I bit in order to be serviced.
However, disabled interrupts may be latched and processed when they are enabled (see
Section 7.2: External interrupts).
Note:
After reset, all interrupts are disabled.
lete Prodduucctt((ss)) Note:
OObbssoolleettee PPrroodduucctt((ss)) -- OObbssoolete Pro 7.1
When an interrupt has to be serviced:
● Normal processing is suspended at the end of the current instruction execution.
● The PC, X, A and CC registers are saved onto the stack.
● The I bit of the CC register is set to prevent additional interrupts.
● The PC is then loaded with the interrupt vector of the interrupt to service and the first
instruction of the interrupt service routine is fetched (refer to Table 15: Interrupt
mapping for vector addresses).
The interrupt service routine should finish with the IRET instruction which causes the
contents of the saved registers to be recovered from the stack.
As a consequence of the IRET instruction, the I bit is cleared and the main program
resumes.
Priority management
By default, a servicing interrupt cannot be interrupted because the I bit is set by hardware
entering in interrupt routine.
In the case when several interrupts are simultaneously pending, a hardware priority defines
which one will be serviced first (see Table 15: Interrupt mapping).
Interrupts and low power mode
All interrupts allow the processor to leave the Wait low power mode. Only external and
specifically mentioned interrupts allow the processor to leave the Halt low power mode (refer
to the “Exit from HALT” column in Table 15: Interrupt mapping).
Non-maskable software interrupt
This interrupt is entered when the TRAP instruction is executed regardless of the state of
the I bit. It is serviced according to the flowchart in Figure 18.
37/124