Program Example For Watchdog Timer - Fujitsu F2MC-8L Series Hardware Manual

8-bit microcontroller
Hide thumbs Also See for F2MC-8L Series:
Table of Contents

Advertisement

CHAPTER 6 WATCHDOG TIMER
6.6

Program Example for Watchdog Timer

This section gives a program example for the watchdog timer.
Program Example for Watchdog Timer
Processing description
Selects watch prescaler as a count clock and 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 998.6 ms at 4.2 MHz operation).
Coding example
WDTC
EQU
WDT_CLR
EQU
VECT
DSEG
ORG
RST_V
DW
VECT
ENDS
;-----Main program----------------------------------------------------------------------------------------------------------------------------------------
CSEG
PROG
MOVW
:
Initialization of peripheral functions (interrupts), etc.
:
INIT
MOV
:
MAIN
MOV
:
User processing (interrupt processing may occur during this cycle)
154
00009H
; Address of the watchdog timer control register
10000101B
ABS
; [DATA SEGMENT]
0FFFEH
PROG
; Set reset vector.
; [CODE SEGMENT]
; Initialization routine after a reset
SP,#0280H
; Set initial value of the stack pointer (for interrupt processing).
WDTC,#WDT_CLR
; Activate the watchdog timer.
; Select the watch prescaler as a count clock.
WDTC,#WDT_CLR
; Clear the watchdog timer.

Advertisement

Table of Contents
loading

Table of Contents