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
Содержание MB89950 Series
Страница 2: ......
Страница 3: ...FUJITSU LIMITED F2MC 8L 8 BIT MICROCONTROLLER MB89950 950A Series HARDWARE MANUAL ...
Страница 4: ......
Страница 10: ...vi ...
Страница 34: ...20 CHAPTER 2 HANDLING DEVICES ...
Страница 134: ...120 CHAPTER 6 WATCHDOG TIMER ...
Страница 236: ...222 CHAPTER 10 UART ...
Страница 276: ...262 CHAPTER 12 LCD CONTROLLER DRIVER ...
Страница 310: ...296 APPENDIX ...
Страница 311: ...297 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Страница 316: ...302 INDEX ...
Страница 318: ......