![](http://datasheet.mmic.net.cn/30000/M30245MC-XXXGP_datasheet_2358670/M30245MC-XXXGP_60.png)
M30245 Group
Interrupts
Rev.2.00
Oct 16, 2006
page 58 of 264
REJ03B0005-0200
Figure 1.34. Interrupt sequence timing
Returning from an Interrupt Routine
Executing the REIT instruction at the end of an interrupt routine restores the contents of the flag register (FLG) as it was
immediately before the start of the interrupt sequence and the contents of the program counter (PC), both of which were
saved in the stack area. Then control returns to the program that was being executed before the acceptance of the
interrupt request, so that the suspended process resumes.
Return the other registers that were saved by software within the interrupt routine using the POPM instruction or a
similar instruction before executing the REIT instruction.
Interrupt priority
The order of priority when two or more interrupts are generated simultaneously is determined by both hardware and
software.
The interrupt priority levels determined by hardware are:
____________
_______
RESET > NMI > DBC > Watchdog Timer > Peripheral I/O > Single step > Address match
The interrupt priority levels determined by software are set in the interrupt control registers.
When two or more interrupts are generated simultaneously, the interrupt with the higher software priority is selected.
However, if the interrupts have the same software priority level, the interrupt is selected according to the hardware
priority set in the circuit.
The selected interrupt is accepted only when the priority level is higher than the processor interrupt priority level (IPL) in
______
_______
the flag register (FLG) and the interrupt enable flag (I flag) is "1" Note that the reset, NMI, DBC, watchdog timer, single-
step, address-match, BRK instruction, overflow, and undefined instruction interrupts are accepted regardless of the
interrupt enable flag (I flag).
Interrupt Priority Level Select Bit and Processor Interrupt Priority Level (IPL)
Set the interrupt priority level using the interrupt priority level select bits, which consists of three interrupt control register
bits. When an interrupt request occurs, the interrupt priority level is compared with the IPL of the CPU flag register. The
interrupt is enabled only when the priority level of the interrupt is higher than the IPL. Therefore, setting the interrupt
priority level to "0" disables the interrupt.
1
2
34
56
78
9
10
11
12
The indeterminate segment is dependent on the queue buffer.
If the queue buffer is ready to take an instruction, a read cycle occurs.
Indeterminate
SP-2 contents
SP-4 contents
Interrupt
information
Address 0000
Indeterminate
SP-2
SP-4
PC
BCLK
Internal
Address bus
Internal
Data bus
R
Indeterminate
vec
vec + 2
contents
vec
contents
W