NEC PD17062 Datasheet page 148

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

Advertisement

12.5.1 Example of Using a Timer Based on a Timer Interrupt
An example follows.
Example
BR
AAA
TIMER:
ADD
M1, #0001B ; Add 1 to M1.
SKT1
CY
BR
BBB
Process A
BBB:
EI
RETI
AAA:
INITFLG NOT BTM0ZX, NOT BTM0CK2, NOT BTM0CK1, NOT BTM0CK0
MOV
M1, #0000B ; Clears the content of M1 to 0.
SET1
IPBTM0
EI
LOOP:
Process B
BR
LOOP
This program performs process A at every 80 ms.
At this point, note the following: Accepting an interrupt request causes a DI state automatically, and the
IRQBTM0 flag is set to 1 even in the DI state.
In other words, if process A takes 5 ms or longer, an interrupt request will be accepted immediately when
a return is made by a RETI instruction, thus disabling process B from being performed.
148
; Branches to AAA.
; Program address 0003H
; Tests the CY flag.
; Returns if no carry is generated.
; Built-in macro
; Specifies the timer interrupt pulse as 5 ms.
; Enables a timer interrupt.
; Enables all types of interrupts.
PD17062

Advertisement

Table of Contents
loading

Table of Contents