Fujitsu F2MC-8L MB89620 Series Hardware Manual page 156

8-bit microcontroller
Table of Contents

Advertisement

6
6.
Program Example for Watchdog Timer
This section gives a program example for the watchdog timer.
n Program Example for Watchdog Timer
Processing description
l
Activates the watchdog timer immediately after the program.
Clears the watchdog timer in each loop of the main program.
The processing time for the main loop, including interrupt processing, must be less than the
minimum interval time of the watchdog timer (approximately 209.7 ms at 10 MHz operation).
Coding example
l
WDTC
WDT_CLR
VECT
RST_V
VECT
;-----Main program---------------------------------------------------------------------------------------------------------------------------------------
PROG
INIT
MAIN
;--------------------------------------------------------------------------------------------------------------------------------------------------------------
MB89620 series
EQU
00009H
EQU
00000101B
DSEG
ABS
ORG
0FFFEH
DW
PROG
ENDS
CSEG
MOVW
SP,#047FH
:
Initialization of peripheral functions (interrupts), etc.
:
MOV
WDTC,#WDT_CLR
:
MOV
WDTC,#WDT_CLR
:
User processing (interrupt processing may occur during this cycle)
:
JMP
MAIN
ENDS
END
; Address of the watchdog timer control register
; [DATA SEGMENT]
; Set reset vector.
; [CODE SEGMENT]
; Initialization routine after a reset
; Set initial value of the stack pointer (for interrupt processing).
; Activate the watchdog timer.
; Clear the watchdog timer.
; The loop must be executed in less than the minimum interval
time of the watchdog timer.
CHAPTER 6 WATCHDOG TIMER
135

Advertisement

Table of Contents
loading

Table of Contents