Specifications
Programming the Watchdog Timer
_____________________________________________________________________________
T he
Magnum
features a wat chdog timer that can generate a s y s tem
reset if the CPU processing comes to a hal t. This feature ens ur es
the s ys tem dependability during unattended oper ation.
T he following is the Watchdog T imer instruction:
•
IOW 444(Hex),Timer(Hex) ---------
Enable/Setting/refresh Watchdog Timer
Timer: 64 levels setting (1 ~ 64 seconds, tolerance +-20%)
•
IOR 441(Hex) --------------------------
Disable Watchdog Timer
I f you want to us e the watchdog timer , you must write a pr ogr am
which writes I/O por t addr ess 444(Hex) at timer setting inter vals. The
first time your program writes the por t, it sets and enables the
watchdog timer . Program must write the por t at time inter vals .
Otherwise the watchdog timer will activate and r es et the CPU. When
you want to dis able the watchdog timer , your program should r ead I /O
port 441(Hex).
I f CPU processing come to a s tands ti ll because of a s oftwar e bug
or EMI, program’s signals to I /O por t address 444(Hex) to the timer
will be interrupted. The watchdog timer will automatically reset the
CPU, and data pr ocessing will continue nor mally.
Example pr ogr am
5 REM Watchdog timer
10 X=OUTP(&H444)Timer REM Enable / Setting the Watchdog timer
15 GOSUB 500
20 X=OUTP(&H444)Timer REM Refresh the Watchdog timer
25 GOSUB 600
30 X=OUTP(&H444)Timer REM Refresh the Watchdog timer
35 GOSUB 800
X=INP(&H441) REM Disable Watchdog timer
45 END
500 REM Subroutine takes shorter than setting level to complete
.
.
550 RETURN
600 REM Subroutine takes shorter than setting level to complete
.
.
680 RETURN
800 REM Subroutine takes shorter than setting level to complete
.
.
870 RETURN