2–50
Watchdog Timer
The purpose of a watchdog timer function is to restart the system should some mishap occur.
Possible problems include: a failure to boot properly; the application software losing co ntrol;
temporary power supply problems including spikes, surges, or interference; the failure of an
interface device; unexpected conditions on the bus; or other hardware or software malfunctions. The
watchdog timer helps assure proper start-up after an inte rru ption.
The Little Board/P5x ROM-BIOS supports the board’s watchdog timer f unctio n in tw o way s:
! There is an initial watchdog timer setting, specified using SETUP, which determine s wheth er
the watchdog timer will be used to monitor the system boot, and if so, how lo ng the time-ou t is
(30, 60, or 90 seconds).
! There is a standard ROM-BIOS function which may be used by application software to start and
stop the watchdog timer function.
The initial time-out should be set (using SETUP) to be long enough to guarantee that the system
can boot and pass control to the application. Then, the application must periodically retrigg er the
timer by reading I/O Port 201h so that the time-out does not occur. If the time-out does occur, th e
system will respond in a manner determined by how the watchdog timer ju mper, W8, is se t (see
Chapter 2).
The following simple assembly language routine illustrates how to control the watchdo g timer usin g
the Ampro ROM-BIOS function that has been provided for this purpose:
;----------------------------------------------------------
; Watchdog timer control program
;----------------------------------------------------------
MOV AH,0C3h ; Watchdog Timer BIOS function
MOV AL,nn ; Use “00” to disable, “01” to enable
; timer.
MOV BX,mm ; Selects time, in seconds
;(00-FFh; 1-255 seconds)
INT 15h
Ampro provides a simple DOS program that can be used from the command line or in a batch
program to manage the watchdog timer. It is called WATCHDOG, and is described in the Ampro
Common Utilities manual.