174
CHAPTER 12 INTERRUPT FUNCTIONS
User’s Manual U15104EJ2V0UD
Figure 12-13. Multiple Interrupt Servicing Example (1/2)
Example 1. Example where multiple interrupt occurs two times
Example 2. Example where multiple interrupt does not occur because of priority control
Two interrupt requests, INTyy and INTzz, are acknowledged while interrupt INTxx is serviced, and
multiple interrupt occurs. Before each interrupt request is acknowledged, the EI instruction is always
executed, and the interrupt is enabled.
Interrupt request INTyy that is generated while interrupt INTxx is being serviced is not acknowledged
because its priority is lower than that of INTxx, and therefore, multiple interrupt does not occur. INTyy
request is held pending, and is acknowledged after one instruction of the main routine has been
executed.
PR = 0: High-priority level
PR = 1: Low-priority level
IE = 0:
Acknowledging interrupt request is disabled.
Main processing
EI
INTxx
(PR = 1)
INTyy
(PR = 0)
IE = 0
EI
RETI
INTxx
service
INTzz
(PR = 0)
IE = 0
EI
RETI
INTyy
service
IE = 0
RETI
INTzz
service
Main processing
INTxx
service
INTyy
service
INTxx
(PR = 0)
1 instruction
execution
IE = 0
INTyy
(PR = 1)
EI
IE = 0
EI
RETI
RETI