MB89190/190A series
Chapter 3 CPU
3-19
3.4 Interrupts
3.4.3 Multiple Interrupts
Multiple interrupts can be performed by setting different interrupt levels in the in-
terrupt level setting registers (ILR1, 2, 3) when two or more interrupt requests are
issued from the resource function.
T Multiple interrupts
When an interrupt request with a higher interrupt level occurs during execution of the interrupt-processing
routine, the current interrupt processing is suspended and the higher-level interrupt request is accepted.
The interrupt level that can be set is 1 to 3. When level 3 is set, the CPU does not accept the interrupt
request.
Example of multiple interrupts
As an example of a multiple interrupt, it is assumed that external interrupt is preferred to timer
interrupt; the timer interrupt level is set to 2, and the external interrupt level set to 1. Under this
condition, when an external interrupt occurs during timer interrupt processing, the processing shown in
Figure 3.4.3 is performed.
Fig. 3.4.3 Multiple Interrupt
– During timer interrupt processing, the interrupt level bits of the condition code register (CCR: IL1, 0)
are the same (2 in above example) as the value of the interrupt level setting registers (ILR1, 2, 3)
associated with the timer interrupt. At this point, when an interrupt request with a higher interrupt
level (1 in above example) occurs, that interrupt processing is preferred.
– To temporarily disable multiple interrupts during timer interrupt processing, the interrupt enable flag
in the condition code register is set to Disable (CCR: I = 0), or the interrupt level bits (IL1, 0) are set
to 00B.
– When interrupt processing terminates and the interrupt return instruction (
RETI) is executed, the
value of the program counter (PC) and the program status (PS) saved in the stack is returned,
returning control to processing of the interrupted program.
– The condition code register (CCR) becomes the value before the interrupt when the program status
(PS) is returned.
Occurrence of timer
interrupt
Main program
Initialization of
resource(s)
Timer Interrupt processing
External interrupt
processing
Occurrence
of external
interrupt
External interrupt
processing
Return to external
interrupt
Timer Interrupt
processing
Return to timer interrupt
Restart of main program
Suspend
Restart
Interrupt level 2
(CCR: IL1, 0 = 10)
Interrupt level 1
(CCR: IL1, 0 =
01)
(1)
(3)
(4)
(2)
(8)
(6)
(7)
(5)