18
ICOP Embedded 386SX PC/104 AIO CPU Module User's Manual
out 23h, al
nop
nop
Lock configuration register
Watchdog Program Example
We use the following sequence to initialize the watchdog timer:
(1) Unlock configuration register.
(2) Disable watchdog timer by setting INDEX 37H Bit 6 to ‘0’.
(3) Set the expected counter value to INDEX 3BH, 3AH, 39H.
(4) Select timeout action from INDEX 38H Bit 7-4.
(5) Enable watchdog timer by setting INDEX 37H Bit 6 to ‘1’.
(6) Lock configuration register.
Example: Set timeout to 128 sec to generate a system RESET.
; Please use MASM to compiler the following program
; Execute under DOS environment
dosseg
. model small
. stack 100h
.code
main proc
mov ax, 0c513h ; Unlock config. register
call writechip
mov ax, 03737h ; Disable watchdog timer
call readchip
and al, 10111111b
xchg ah, al
call writechip
mov ax, 0403bh ; Set the expected counter