119
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
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 419.43 ms at 5 MHz operation).
●
Coding example
WDTC EQU 0009H ; Address of the watchdog timer control register
WDT_CLR EQU 00000101B
VECT DSEG ABS ; [DATA SEGMENT]
ORG 0FFFEH
RST_V DW PROG ; Set reset vector.
VECT ENDS
;-----Main program---------------------------------------------------------------
CSEG ; [CODE SEGMENT]
PROG ; Initialization routine after a reset
MOVW SP,#0280H ; Set initial value of stack pointer
(for interrupt processing).
:
Initialization of peripheral functions (interrupts), etc.
:
INIT MOV WDTC,#WDT_CLR ; Activate the watchdog timer.
:
MAIN MOV WDTC,#WDT_CLR ; Clear the watchdog timer.
:
User processing (interrupt processing may occur during this cycle)
:
JMP MAIN ; The loop must be executed in less than the
minimum interval time of the watchdog timer.
ENDS
;--------------------------------------------------------------------------------
END
Summary of Contents for MB89950 Series
Page 2: ......
Page 3: ...FUJITSU LIMITED F2MC 8L 8 BIT MICROCONTROLLER MB89950 950A Series HARDWARE MANUAL ...
Page 4: ......
Page 10: ...vi ...
Page 34: ...20 CHAPTER 2 HANDLING DEVICES ...
Page 134: ...120 CHAPTER 6 WATCHDOG TIMER ...
Page 236: ...222 CHAPTER 10 UART ...
Page 276: ...262 CHAPTER 12 LCD CONTROLLER DRIVER ...
Page 310: ...296 APPENDIX ...
Page 311: ...297 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Page 316: ...302 INDEX ...
Page 318: ......