Program Examples Of Watchdog Timer And Time-Base Timer - Fujitsu MB90420/5 (A) Series Hardware Manual

F2mc-16lx family 16-bit microcontrollers
Table of Contents

Advertisement

WATCHDOG TIMER/TIME-BASE TIMER/WATCH TIMER (SUB-CLOCK)

9.6 Program Examples of Watchdog Timer and Time-base Timer

Program example of watchdog timer and time-base timer are given below:
n Program exapmle of watchdog timer sample program
• Processing specification
– The watchdog timer is cleared each time in loop of the main program.
– The main loop must be executed once within the minimum interval time of the watchdog timer.
• Coding example
WDTC
EQU
WTE
EQU
Main program
;----------
CODE
CSEG
START:
;
WDG_START:
MOV
Main loop
;----------
MAIN:
CLRB
;
Processing by user
;
;
JMP
CODE
ENDS
Vector setting
;----------
-
VECT
CSEG
ORG
DSL
DB
VECT
ENDS
END
0000A8
;
H
WDTC:2
;
------------------------------------------------------------
;
WDTC, #00000011
;
B
;
----------------------------------------------------------------
I:WTE
;
MAIN
;
;
----------------------------------------------------------
ABS=0FF
H
0FFDC
;
H
START
00
;
H
START
Watchdog timer control register
Watchdog control bit
Stack pointer (SP), already initialized
Watchdog timer started
±2
21
18
Interval time of 2
Watchdog timer cleared
2 bits cleared periodically
Watchdog timer interval time
Loop executed in shorter time
Reset vector setting
Set to single-chip mode
9-19
cycles selected

Advertisement

Table of Contents
loading

Table of Contents