
40
Appendix A Watchdog Timer
Watchdog Timer is a device to ensure that standalone systems can always
recover from catastrophic conditions that cause CPU crash which may be caused
by external EMI or a software bug. When the CPU stops working normally,
hardware on the board will issue a time-out signal.
A BIOS function call (INT 15H) is used to control Watchdog Timer:
INT 15H:
AH – 6FH
Sub-function:
AL – 2 : Set the Watchdog Timer’s period
BL: Time-out value(the time unit--second, is
dependent on the item “Watchdog Timer unit
(selected in BIOS setup).
You have to call sub-function 2 to set the time-out period of Watchdog Timer first.
If the time-out value is not zero, Watchdog Timer will start counting down. When
the timer value reaches zero, the system will reset. To ensure reset condition
does not occur, Watchdog Timer must be periodically refreshed by calling sub-
function 2. However the Watchdog timer will be disabled if you set the time-out
value to be zero.
A tolerance of at least 10% must be maintained to avoid unknown routines within
the operating system (DOS), such as disk I/O that can be very time-consuming.
Note: When exiting a program, it is necessary to disable Watchdog Timer,
otherwise the system will reset.
Example program:
; INITIAL TIMER PERIOD COUNTER
;
W_LOOP:
MOV AX, 6F02H ;setting the time-out value
MOV BL, 30 ;time-out value is 48 seconds
INT 15H
;
; ADD YOUR APPLICATION PROGRAM HERE
;
CMP EXIT_AP, 1 ;is your application over?
JNE W_LOOP ;No, restart your application
MOV AX, 6F02H ;disable Watchdog Timer
MOV BL, 0 ;
INT 15H
;
; EXIT