![](http://datasheet.mmic.net.cn/30000/M32170F3VFP_datasheet_2359455/M32170F3VFP_141.png)
5
5-20
32170/32174 Group User's Manual (Rev. 2.1)
5.5.2 Processing by Internal Peripheral I/O Interrupt by Handlers
(1) Branching to the interrupt handler
Upon accepting an interrupt request, the CPU branches to the EIT vector entry after performing
the hardware preprocessing as described in Section 4.3, "EIT Processing Procedure." The EIT
vector entry for External Interrupt (EI) is located at the address H'0000 0080. This address is
where the instruction (not the jump address itself) for branching to the beginning of the interrupt
handler routine for external interrupt requests is written.
(2) Processing in the External Interrupt (EI) handler
A typical operation of the External Interrupt (EI) handler (for interrupts from internal peripheral I/
O) is shown in Figure 5.5.2.
[1] Saving each register to the stack
Save the BPC, PSW and general-purpose registers to the stack. Also, save the
accumulator and FPSR register to the stack as necessary.
[2] Reading the Interrupt Request Mask Register (IMASK) and saving to the stack
Read the Interrupt Request Mask Register and save its content to the stack.
[3] Reading the Interrupt Vector Register (IVECT)
Read the Interrupt Vector Register. This register holds the 16 low-order address bits of the
ICU vector table for the accepted interrupt request source that was stored in it when
accepting an interrupt request. When the Interrupt Vector Register is read, the following
processing is automatically performed in hardware:
The interrupt priority level of the accepted interrupt request (ILEVEL) is set in the IMASK
register as a new IMASK value. (Interrupts with lower priority levels than that of the
accepted interrupt request source are masked.)
The accepted interrupt request source is cleared (not cleared for level-recognized
interrupt request sources).
The interrupt request (EI) to the CPU core is dropped.
The ICU's internal sequencer is activated to start internal processing (interrupt priority
resolution).
[4] Reading and overwriting the Interrupt Request Mask Register (IMASK)
Read the Interrupt Request Mask Register and overwrite it with the read value. This write to
the IMASK register causes the following processing to be automatically performed in
hardware:
The interrupt request (EI) to the CPU core is dropped.
The ICU's internal sequencer is activated to start internal processing (interrupt priority
resolution).
Note: Processing in [4] here is unnecessary when multiple interrupts are to be enabled in
[6] below.
INTERRUPT CONTROLLER (ICU)
5.5 Description of Interrupt Operation