Advantech PCA-6143P User Manual page 48

Table of Contents

Advertisement

If you decide to program the watchdog timer, you must write a
program which reads I/O port address 443 (hex) at regular
intervals. The first time your program reads the port, it enables the
watchdog timer. After that your program must read the port at time
intervals less than 2.0 seconds (as set in the BIOS), otherwise the
watchdog timer will activate and reset the CPU or generate an
interrupt on IRQ15. When you want to disable the watchdog timer,
your program should read I/O port 043 (hex).
If CPU processing comes to a standstill because of EMI or a
software bug, your program's signals to I/O port address 443 to the
timer will be interrupted. The timer will then automatically reset
the CPU or invoke an IRQ, and data processing will continue
normally.
The following program shows how you might program the
watchdog timer in BASIC:
10
REM Watchdog timer example program
15
REM Watchdog timer interval set to 2 sec in BIOS
20
X=INP(&H443) REM Enable and refresh the watchdog
30
GOSUB 1000 REM
40
X=INP(&H443) REM Refresh the watchdog
50
GOSUB 2000 REM
60
X=INP(&H043) REM Disable the watchdog
70
END
1000
REM Subroutine #2, takes 2 seconds to complete
.
.
.
1070
RETURN
2000
REM Subroutine #2, takes 2 seconds to complete
.
.
.
2090
RETURN
48 PCA-6143P User's Manual
Task #2, takes 2 sec to complete
Task #2, takes 2 sec to complete

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents