3.3 Interrupts
202
Chapter 3:Operation
(3) Operation
On-chip resources with a hardware interrupt request function have an ‘interrupt request flag,’ which
indicates the existence of an interrupt request, and an ‘interrupt enable flag,’ which the resource uses to
select whether or not to issue its own interrupt requests to the CPU. The interrupt request flag is set by
the occurrence of an event unique to that resource; if the interrupt enable flag is set to “enabled,” the
resource uses an interrupt request to the interrupt controller.
The interrupt controller compares the level of individual interrupt requests that are received
simultaneously with the interrupt level (IL) in the ICR, selects the request with the highest level (the
smallest IL value) and notifies the CPU. If there are multiple requests with the same interrupt level, the
interrupt with the smaller interrupt level number is given priority. The relationship between each
interrupt request and each ICR is determined by the hardware.
The CPU compares the interrupt level that it received with the ILM bits in the PS register, and if the
interrupt level is less than the ILM and the I bit in the PS register is set to “1”, then once the instruction
that is currently being executed is terminated, the CPU begins executing the interrupt processing
microcode. At the top of the interrupt processing microcode, the ISE bit in the ICR in the interrupt
controller is referenced; after confirming that it is “0” (i.e., an interrupt), the main body of interrupt
processing is initiated.
In the main body of interrupt processing, after the 12 bytes of the PS and PC, PCB, DTB, ADB, DPR,
and A are saved to the memory locations indicated by the SSB and SSP, a three-byte fetch is performed
to get the interrupt vector, which is loaded into the PC and PCB. After updating the ILM bits in the PS
to the level of the interrupt request that was accepted, the S flag is set and branch processing is
performed. As a result, the next instruction that is executed is the user-defined interrupt processing
program.
Fig. 3.3.1 shows the flow of processing from the occurrence of the hardware interrupt until the point
when there are no more interrupt requests in the interrupt processing program. Fig. 3.3.2 shows the
operational flow of hardware interrupts.
INT 42
FFFF54H
FFFF55H
FFFF56H
Unused
#42
Delay interrupt
INT 43
FFFF50H
FFFF51H
FFFF52H
Unused
#43
None
INT 254
FFFC04H
FFFC05H
FFFC06H
Unused
#254
None
INT 255
FFFC00H
FFFC01H
FFFC02H
Unused
#255
None
Table 3.3.1 MB90660A Interrupt Assignment Table (2)
Software
interrupt
instruction
Vector
address L
Vector
address M
Vector
address H
Mode
register
Interrupt No.
Hardware interrupt
..
.
..
.
..
.
..
.
..
.
..
.
..
.