
OPERATION
3-6
3.3 INTERRUPT
If the interrupt controller and CPU are ready to accept interrupts when an interrupt request is output from the
internal resources or by an external-interrupt input, the CPU temporarily suspends the currently-executing
instruction and executes the interrupt-processing program. Figure 3.4 shows the interrupt-processing flow-
chart.
Internal bus
Register file
IPLA
IR
PS
I
IL
Check
Comparator
MB8914X CPU
(4)
(4)
RAM
(8)
(5)
Enable FF
Source FF
Main program
Reset clear
(1) Initialize
interrupt
(2) Execute
main program
(8)
PC, PS restored
Restore PC, PS
(7) Interrupt
processing
IL updated
(5)
PC, PS saved
(3)
Interrupt
generation
(4)
Level
decided
(6) Clear request
AND
Level
comparator
Interrupt controller
(1)
(3)
(6)
Resource
(4)
Interrupt
processing
RETI
Fig. 3.4 Interrupt-processing Flowchart
All interrupts are disabled after a reset is cleared. Therefore, initialize interrupts in the main program (1). Each
resource generating interrupts and the interrupt-level-setting registers (ILR1 to ILR3) in the interrupt controller
corresponding to these interrupts are to be initialized. The levels of all interrupts can be set by the interrupt-
level-setting registers (ILR1 to ILR3) in the interrupt controller. The interrupt level can be set from 1 to 3, where
1 indicates the highest level, and 2 the second highest level. Level 3 indicates that no interrupt occurs. The
interrupt request of this level cannot be accepted. After initializing the registers, the main program executes
various controls (2). Interrupts are generated from the resources (3). The highest-priority interrupt requests
are identified from those occurring at the same time by the interrupt controller and are transferred to the CPU.
The CPU then checks the current interrupt level and the status of the I-flag (4), and starts the interrupt proces-
sing.
The CPU performs the interrupt processing to save the contents of the current PC and PS in the stack (5) and
fetches the entry addresses of the interrupt program from the interrupt vectors. After updating the IL value in
the PS to the required one, the CPU starts executing the interrupt-processing routine.
Clear the interrupt sources (6) and process the interrupts in the user’s interrupt-processing routine. Finally,
restore the PC and PS values saved by the RETI instruction in the stack (8) to return to the interrupted instruc-
tion.
Note: Unlike the F
2
MC-8 family, A and T are not saved in the stack at the interrupt time. If interrupts of the
same level occur at the same time, IRQ0 takes precedence.
Содержание F2MC-8L Series
Страница 121: ...INSTRUCTIONS 4 7 4 5 F2MC 8L FAMILY INSTRUCTION MAP ...
Страница 123: ...5 MASK OPTIONS ...
Страница 125: ...APPENDIX ...