Electronics America 4-Bit Single-Chip Microcomputer User's Manual
137
CHAPTER 6. INTERRUPT FUNCTIONS
6.6 INTERRUPT APPLICATIONS
When the interrupt function is used, the following setting are first carried out in the main program.
➀ The interrupt enable flag corresponding to the interrupt to be used is set to “1” (EI IE××× instruction).
➁ If INT0 is used, the active edge is selected (IM0 setting).
➂ The interrupt master enable flag (IME) is set to “1” (EI instruction).
Return from the interrupt service program is by means of an RETI instruction.
(1) Interrupt enabling/disabling
➀ Reset
➁ EI IE0
➁ EI IECSI
➂ EI
➃ DI IE0
➄ DI
INT0 & INTCSI enabled
INTCSI enabled
Interrupts disabled
Interrupts disabled
<Main Program>
➀ All interrupts disabled by RESET input.
➁ Interrupt enable flag set by EI IE××× instruction.
At this stage, all interrupts are still disabled.
➂ Interrupt master enable flag set by EI instruction.
At this stage, INT0 & INTCSI are enabled.
Interrupt enable flag cleared by DI IE××× instruction; INT0 disabled.
➄ All interrupts disabled by DI instruction.
4