
Interrupts
Specifications in this manual are tentative and subject to change
Rev. E
MITSUBISHI MICROCOMPUTERS
M30245 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
58
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 instruc-
tion 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.
Figure 1.34.
Interrupt sequence timing
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