CHAPTER 6. INTERRUPT FUNCTIONS

(2) Example using INTBT, INT0 (falling edge active), and INTCSI

<Main Program>

Reset

MOV

A, #1

MOV

IM0, A

CLR1

IRQ0

EI

IEBT

EI

IE0

IECSI

EI

 

EI

 

; MBE = 0

Status 0

<INT0 Service Program>

 

 

 

 

INT0

Status 1

RETI

Status 0

All interrupts disabled and status 0 set by RESET input.

INT0 set to falling edge active.

Interrupts enabled by EI and EI IE××× instructions.

4On fall of INT0, INT0 interrupt service program is started, status is changed to 1 and all interrupts are

disabled.

RETI instruction effects return from interrupt, restores status to 0, and enables interrupts.

138

Page 149
Image 149
NEC PD75402A, PD75P402 user manual Example using INTBT, INT0 falling edge active, and Intcsi, 138, CLR1 IRQ0, ➄ Reti