
Rev.2.10 Apr 14, 2006 page 92 of 378
REJ09B0124-0210
M16C/6N Group (M16C/6NK, M16C/6NM) 10. Interrupts
10.5.8 Returning from Interrupt Routine
The FLG register and PC in the state in which they were immediately before entering the interrupt
sequence are restored from the stack by executing the REIT instruction at the end of the interrupt routine.
Thereafter the CPU returns to the program which was being executed before accepting the interrupt
request.
Return the other registers saved by a program within the interrupt routine using the POPM or similar
instruction before executing the REIT instruction.
Register bank is switched back to the bank used prior to the interrupt sequence by the REIT instruction.
10.5.9 Interrupt Priority
If two or more interrupt requests are sampled at the same sampling points (a timing to detect whether an
interrupt request is generated or not), the interrupt request with the highest priority is acknowledged.
For maskable interrupts (peripheral functions interrupt), any desired priority level can be selected using
bits ILVL2 to ILVL0. However, if two or more maskable interrupts have the same priority level, their
interrupt priority is resolved by hardware, with the highest priority interrupt accepted.
The watchdog timer and other special interrupts have their priority levels set in hardware.
Figure 10.9 shows the Hardware Interrupts Priority.
Software interrupts are not affected by the interrupt priority. If an instruction is executed, control branches
invariably to the interrupt routine.
Figure 10.9 Hardware Interrupt Priority
10.5.10 Interrupt Priority Level Select Circuit
The interrupt priority level select circuit selects the highest priority interrupt when two or more interrupt
requests are sampled at the same sampling point.
Figure 10.10 shows the Interrupts Priority Select Circuit.
Reset
Oscillation stop and re-oscillation detection
Watchdog timer
Peripheral function
Single step
Address match
High
Low
NMI
DBC
Kommentare zu diesen Handbüchern