
ML66525 Family User’s Manual
Chapter 15
Interrupt Processing Functions
15 - 3
15.3 Description of Interrupt Processing
15.3.1 Non-Maskable Interrupt (NMI)
The non-maskable interrupt (NMI) is an external interrupt that cannot be masked.
When the valid edge specified by bits 4 and 5 (NMIM0, NMIM1) of EXI2CON is detected, the
CPU immediately transfers processing to the non-maskable interrupt.
However, the one exception occurs after reset (RESn signal input, execution of a BRK
instruction, overflow of the watchdog timer, opcode trap), where the non-maskable interrupt is
masked until execution of the first instruction is complete.
This function is intended to
prevent loss of program control after reset in the case where the non-maskable interrupt occurs
before the system stack pointer (SSP) is set with a value (when the SSP is undefined).
Therefore, operated as part of the above NMI function, set an appropriate value in SSP with the
“first instruction after reset”.
[Related information reference guide]
NMI settings
… page 14-4
When the non-maskable interrupt (NMI) occurs, a sequence such as listed below is
automatically processed by the hardware and the first instruction of the NMI routine is
executed.
14 cycles are used to transfer to the NMI routine.
Save the program counter (PC)
Save the accumulator (ACC)
Save the local register base (LRB)
Save the program status word (PSW)
Reset the non-maskable interrupt request flag
Disable maskable interrupts
Disable multiple interrupts by the non-maskable interrupt
Load the program counter with the value that has been written to the NMI routine vector
table (0008H, 0009H)
Use an RTI instruction at the end of the NMI routine.
When an RTI instruction is executed, the hardware automatically processes a sequence such as
listed below to complete the NMI routine.
12 cycles are used to return from the NMI routine.
Restore the program status word (PSW)
Restore the local register base (LRB)
Restore the accumulator (ACC)
Restore the program counter (PC)
Enable maskable interrupts
Enable multiple interrupts by the non-maskable interrupt
Figure 15-1 shows examples of saving and restoring the PC, ACC, LRB and PSW.