![](http://datasheet.mmic.net.cn/330000/MB90F562_datasheet_16437954/MB90F562_160.png)
136
CHAPTER 6 INTERRUPTS
MB90560 series
6.4
6.4.1 Operation of hardware interrupts
Hardware Interrupts
This section explains hardware interrupt operation from generation of a hardware
interrupt request to the completion of interrupt processing.
I
Hardware interrupt activation
G
Peripheral function operation (generation of an interrupt request)
A peripheral function that has a hardware interrupt request function also has an interrupt request
flag that indicates the presence of interrupt requests and an interrupt enable flag that determines
whether CPU interrupt requests are enabled or disabled. The interrupt request flag is set when
an event specified by the peripheral function occurs.
G
Interrupt controller operation (interrupt request control)
When two or more interrupt requests are received at the same time, the interrupt controller
compares their interrupt levels (IL) in their interrupt requests register. The interrupt controller
selects the request with the highest level (with the smallest IL value) and posts it to the CPU.
When multiple requests have the same level, the request with the smallest interrupt number has
the highest priority.
G
CPU operation (interrupt request acceptance and interrupt processing)
The CPU compares the received interrupt level (ICR: IL2 to IL0) and the interrupt level mask
register (ILM). If IL < ILM and interrupts are enabled (PS: CCR: I = 1), the CPU activates the
interrupt processing microcode after the instruction currently being executed terminates.
At the beginning of the interrupt processing microcode, the CPU checks the ISE bit in the
interrupt control register (ICR). If ISE = 0, the CPU continues the execution of interrupt
processing. (If ISE = 1, EI
2
OS is activated.)
Interrupt processing saves the contents of the dedicated registers (12 bytes including A, DPR,
ADB, DTB, PCB, PC, and PS) on the system stack (the system stack space indicated by the
SSB and SSP).
The CPU then loads data into the interrupt vector program counters (PCB and PC), updates the
ILM, and sets the stack flag (S) (sets CCR: S = 1 and activates the system stack).
I
Returning from a hardware interrupt
In an interrupt processing program, when the interrupt request flag of the peripheral function that
generated the interrupt cause is cleared and the RETI instruction is executed, 12-byte data
saved on the system stack is restored to the dedicated registers and the processing that was
being executed before branching for the interrupt is resumed.
When the interrupt request flag is cleared, interrupt requests output by the peripheral function to
the interrupt controller are automatically canceled.