Comtrol DM ATS-LNX User Manual

Page 66

Advertising
background image

Appendix D. Changing the WatchDog Timer

66

Changing the WatchDog Timer

The Watch-Dog Timer is activated by reading the value at address 443H. To
ensure that a reset condition does not occur, the timer must be periodically reset to
restart the countdown at the beginning of the defined interval before the time out
period has expired. This is achieved by first disabling the timer by reading address
843H and then re-enabling it by reading the value at 443H before the timer
reaches zero. Refer to the example of the assembly program below.

A tolerance of at least 5% must be maintained to avoid unknown routines within
the operating system, such as disk I/O that can be very time consuming. Therefore
if the time out period has been set to 10 seconds, the I/O port 443H must be read
within 7 seconds.

Note: When exiting a program it is necessary to disable the Watch-Dog Timer,

otherwise the system will reset.

Example of Assembly Program

TIMER_PORT = 443H
TIMER_START = 443H
TIMER_STOP = 843H

;;INITIAL TIME PERIOD COUNTER

MOV DX, TIME_PORT
MOV AL, 8:;;8 SECONDS
OUT DX,AL

;;ADD YOUR APPLICATION HERE

MOV DX, TIMER_START

IN AL, DX.;;START COUNTER

;;ADD YOUR APPLICATION HERE

W_LOOP:
MOV DX, TIMER_STOP
IN AL, DX
MOV DX, TIMER_START
IN AL, DX.

;;RESTART COUNTER
;;ADD YOUR APPLICATION HERE

CMP EXIT_AP, 0
JNE W_LOOP
MOV DX, TIMER_STOP
IN AL, DX

;;EXIT AP

Advertising