Examples Of Basic Interval Timer Applications - NEC PD75402A User Manual

4-bit single-chip microcomputer
Table of Contents

Advertisement

5.4.4

Examples of Basic Interval Timer Applications

Example
1.
In this example the basic interval timer is enabled, and the interrupt generation interval is set to 1.95
ms (at 4.19 MHz operation).
SEL
MOV
MOV
EI
EI
Example
2.
Example of watchdog timer application
When used as a watchdog timer, the basic interval timer's function of generating an interrupt (INTBT)
at set intervals is used.
First, the standard time generated by the basic interval timer is decided.
Next, the program is divided into a number of modules whose processing should terminate within
the standard time, and the counter (BT) and interrupt request flag (IRQBT) are cleared each time a
module ends. A program is written such that an interrupt (INTBT) is not generated if operation is
normal. In other words, if an interrupt is generated, this is interpreted as indicating inadvertent
program looping.
The interrupt generation interval is set to 31.25 ms (in 4.19 MHz operation) so that the processing
time for each module is less than 31.25 ms.
Initial
Setting
Module 1
Module 2
CHAPTER 5. PERIPHERAL HARDWARE FUNCTIONS
MB15
A, #1111B
BTM,A
; Setting and start
; Enable interrupts
IEBT
; Enable BT interrupts
SEL
MB15
MOV
A, #1011B
MOV
BTM, A
EI
EI
IEBT
MOV A, #1011B
MOV BTM, A
MOV A, #1011B
MOV BTM, A
; or CLR1 MBE
; Interval setting and counter start
Processing termination within 31.25 ms
Processing termination within 31.25 ms
69

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd75p402

Table of Contents