NEC PD75402A Manuale Utente

Pagina di 195
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