MB90420/5 (A) SERIES F
6.4.3 Use Procedure for Hardware Interrupt
Hardware interrupt requires the system stack area, resources, interrupt control registers (ICR), etc., to be
set.
n Use procedure for hardware interrupt
Figure 6.8 shows an example of the use procedure for the hardware interrupt.
START
(1)
Set system stack area
(2)
Initialize resource
Set of ICR in interrupt
(3)
controller
Set resource to start
(4)
operation and interrupt
enable bit enabled.
(5)
Set ILM and I in PS.
Main program
(6)
Interrupt request issued
Main program
(1) Set the system stack area.
(2) Initialize the resource to which an interrupt request can be issued.
(3) Set the Interrupt control register (ICR) in the interrupt controller.
(4) Set the resource to operation start state and the interrupt enable bit enabled.
(5) Set the interrupt level mask register (ILM) and the interrupt enable flag (I) to interrupt acceptable state.
(6) A hardware interrupt request issued when an interrupt occurs in the resource.
(7) In the interrupt handling hardware, the registers are saved and branch to the interrupt processing
program.
(8) Resource is processed for generation of interrupt by the interrupt processing program.
(9) An interrupt request to the resource is cleared.
(10) The interrupt return instruction is executed to return to the program before the branch.
2
MC-16LX FAMILY 16-BIT MICROCONTROLLERS HARDWARE MANUAL
Stack processing and
branch to interrupt vector
(7)
Processing by
hardware
Fig. 6.8 Use Procedure for Hardware Interrupt
(8)
(Execute the interrupt-processing
(9)
(10)
Execute interrupt return instruction
6-18
Interrupt processing program
Interrupt processing generated
from the resource
routine)
Clear interrupt factor
(
)
RETI