
41
3.4 Interrupts
function is turned on (enable F/F = 1) at that time, an interrupt request is output to the interrupt
controller.
(4) The interrupt controller is always monitoring interrupt requests from peripheral functions.
The interrupt controller notifies the CPU of the highest level interrupt among interrupt levels
corresponding to interrupt requests currently generated. If different requests are made with the
same interrupt level, the interrupt controller also determines their priorities.
(5) The CPU checks the value in the interrupt enable flag (CCR: I) when the priority of the
interrupt level it receives is higher (the level value is lower) than the level specified in the
interrupt level bits in the condition code register (CCR: IL1 and IL0). The CPU then accepts the
interrupt when the enable flag is turned on (CCR: I = 1).
(6) Put the values in the program counter (PC) and program status (PS) in the stack, fetch the
start address of the interrupt processing routine from the interrupt vector table concerned,
change the value of the interrupt level bits in the condition code register (CCR: IL1 and IL0) to
the value of the interrupt level accepted, then start the interrupt processing routine.
(7) Finally, restore the values of the program counter (PC) and program status (PS) put into the
stack with the RETI instruction, then execute an instruction following the instruction executed
immediately before the interruption.
Standby mode (low-power consumption mode) is canceled by an interrupt. For details, see
Section
3.7 "Standby Mode (Low-Power Consumption Mode)".
Caution:
An interrupt request flag bit for a peripheral function is not automatically cleared even if the
interrupt request is accepted. Therefore, it is necessary to clear the bit using a program in
the interrupt processing routine (by writing 0 into the interrupt request flag bit normally).
Note:
Clearing an interrupt request flag bit at the beginning of the interrupt processing routine
allows the peripheral function that generated the interrupt to re-generate an interrupt (set an
interrupt request flag bit again) while the interrupt processing routine is being executed.
However, the re-generated interrupt is normally accepted after the interrupt processing
routine ends its current cycle.