The following example shows how you might program the watchdog
timer in BASIC:
10
REM
20
X=Out &H443,1 REM
watchdog
30
GOSUB 1000 REM
complete
40
X=Out &H443,1 REM
50
GOSUB 2000 REM
complete
60
X=Out &H443,0 REM
70
END
1000
REM
.
.
.
1070
RETURN
2000
REM
.
.
.
2090
RETURN
Watchdog timer example program
Task #1, takes 1 second to
Task #2, takes 1 second to
Subroutine #1, takes 1 second to complete
Subroutine #2, takes 1 second to complete
Appendix A Programming the Watchdog Timer 59
Enable and refresh the
Refresh the watchdog
Disable the watchdog