![](http://datasheet.mmic.net.cn/330000/MB90F562_datasheet_16437954/MB90F562_162.png)
138
CHAPTER 6 INTERRUPTS
MB90560 series
6.4
6.4.2 Processing for interrupt operation
Hardware Interrupts
When an interrupt request is generated by the peripheral function, the interrupt
controller transmits the interrupt level to the CPU. If the CPU is able to accept
interrupts, the interrupt controller temporarily interrupts the instruction currently being
executed. The interrupt controller then executes the interrupt processing routine or
activates the extended intelligent I/O service (EI
2
OS).
If a software interrupt is generated by the INT instruction, the interrupt processing
routine is executed regardless of the CPU status. In this case, hardware interrupts are
not allowed.
I
Processing for interrupt operation
Figure 6.4-3 shows the flow of processing for interrupt operation.
Figure 6.4-3 Flow of interrupt processing
START
Main program
YES
YES
YES
YES
Interrupt activation/return processing
YES
YES
NO
NO
NO
NO
NO
EI
2
OS
Software inter-
rupt/exception
processing
Hardware
instruction
EI
2
OS processing
Return
processing
I&IF&IF=1
AND
LM>IL
INT
instruction
ISE = 1
RETI
instruction
Specified
count terminated Alter-
natively, is there a termination
request from the peripheral
function
Fetch the next instruction
and deode
Execute ordinary instruction
(including interrupt processing)
Repetition
of string type (*1) instruction
completed
Move the pointer to the next
instruction by PC update
Return the dedicated
registers from the system
stack, call the interrupt
routine, and return to the
previous routine
I <- 0 (Disable hardware
interrupts)
PCB, PC <- interrupt
vector (Branch to the
interrupt processing routine)
S <- 1 (Activates the
system stack)
ILM <- IL (Transfer the
interrupt level of the accepted
interrupt request to the ILM)
Save the dedicated
registers to the system stack
Save the dedicated registers
to the system stack
String type (*1)
instruction in
progress
*1 When a string type instruction is being executed, the interrupt is evaluated in each step.
I:
Interrupt enable flag of the condition code register (CCR)
IF:
Interrupt request flag of the peripheral function
IE:
Interrupt enable flag of the peripheral function
ILM: Interrupt level mask register (in the PS)
ISE: EI2OS enbale flag ofthe interruptor control register (ICR)
IL:
Interrupt level setting bit of the interrupt control register (ICR)
S:
PCB: Program bank register
PC:
Program counter:
Stack flag of the condition code register (CCR)