
3.3 Interrupts
203
Fig. 3.3.1 Hardware Interrupt Generation and Cancellation
(1)
An interrupt source is generated within the peripheral.
(2)
The interrupt enable bit within the peripheral is referenced, and if interrupts are enabled, an
interrupt request is sent from the peripheral to the interrupt controller.
(3)
After receiving the interrupt request, the interrupt controller determines the priority ranking of
the interrupts that are requested simultaneously, and the interrupt level of the appropriate
interrupt is transferred to the CPU.
(4)
The CPU compares the interrupt level of the request from the controller with the IL bits in the
processor status register.
(5)
Only if the comparison in step (4) indicates that the requested interrupt has a higher priority level
than that of the current interrupt processing, the I flag in the same processor status register is
checked.
(6)
Only if the check in step (5) indicates that the I flag is set to the interrupt enable state, the IL bits
are set to the level of the new request. Once the execution of the current instruction is completed,
interrupt processing immediately is performed and control is immediately passed to the interrupt
processing routine.
(7)
When the software in the user’s interrupt processing routine clears the interrupt source that was
generated in step (1), the interrupt request is completed.
In steps (6) and (7), CPU interrupt processing time is determined as follows.
Interrupt start: 24 + 6 × (machine cycle count from Table 3.3.2)
Recovery from interrupt: 15 + 6 × (machine cycle count from Table 3.3.2)
Table 3.3.2 Compensated Cycle Count for Interrupt Processing Time
Address indicated by stack pointer
Compensated cycle count
Internal area, even address
0
Internal area, odd address
2
F
2 M
C
-1
6
B
u
s
Microcode
Peripheral
In
te
rr
u
p
t
le
v
e
l
(I
L
)
L
e
v
e
l
c
o
m
p
a
ra
to
r
Interrupt
PS:
I:
ILM: Interrupt level mask register
IR:
Register file
PS
I
ILM
F2MC-16L
CPU
controller
…
IR
Comparator
Check
AND
Enable FF
Source FF
(1)
(2)
(3)
(4)
(5)
(6)
(7)
Instruction register
Interrupt enable flag
Processor status