ICOP Technology ICOP-602X User Manual page 31

Icop-602 series embedded 386sx cpu isa half size sbc
Table of Contents

Advertisement

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
call writechip ; to [400000h]
mov ax, 0003ah ; 30.5*sec*400000h= 128 sec
ICOP Embedede 386SX CPU ISA Half Size SBC User's Manual
; value
27

Advertisement

Table of Contents
loading

Table of Contents