NEC PD17062 Datasheet page 163

Mos integrated circuit 4-bit single-chip microcontroller containing pll frequency synthesizer and image display controller
Table of Contents

Advertisement

Example
HLTINT
START:
BR
NOP
INTTM:
BR
INT0:
Process A
EI
RETI
INTTIMER:
Process B
EI
RETI
MAIN:
SET2
SET1
LOOP:
Process C
EI
HALT
#
;
BR
This sample program releases the halt state and performs process B when a timer interrupt request is
accepted. When an interrupt request at the INT
performs process C each time the halt state is released.
If an INT
pin interrupt is requested exactly at the same time with a timer interrupt during the halt state,
NC
the program performs process A for the INT
timer interrupt. When a RETI instruction is executed upon completion of process A, program control is
returned to the BR LOOP instruction at
request is accepted immediately. The BR LOOP instruction is executed only after a RETI is executed upon
completion of process B (timer interrupt handling).
DAT 1000B
; Defines a symbol.
; Address 0000H
MAIN
;
; Timer interrupt vector address (0003H)
INTTIMER
; Branches to INTTIMER (interrupt handling).
; INT
pin interrupt vector address (0004H)
NC
; Interrupt requested at the INT
; Timer interrupt handling
IPBTM0, IPNC
; Built-in macro
; Enables INT
BTM0CK2
; Built-in macro
; Specifies the timer interrupt time interval as 5 ms.
; Main routine processing
; Enables all interrupts.
HLTINT
; Specifies an interrupt as a halt release condition.
LOOP
pin is issued, the program performs process A. It also
NC
pin interrupt, which has a higher hardware priority than the
NC
#
, but this instruction will not be executed. Instead, the timer interrupt
pin
NC
pin and timer interrupts.
NC
PD17062
163

Advertisement

Table of Contents
loading

Table of Contents