
RPBASIC-52 PROGRAMMING GUIDE
2-118
WDOG
Syntax: WDOG [time]
Where: time = 0, 1, or 2
no parameter = toggle watchdog timer
0 = turn off watch dog timer
1 = set timeout interval to 0.38 seconds
2 = set timeout interval to 2.8 seconds
Function: Resets or sets watchdog tim er.
Mode: Run
Use: WDOG
Cards: All. Cards use this command in different ways. Refer to your hardware manual to verify operation.
DESCRIPTION
The w atchdog tim er is a supervisory function fo r applications that ca nnot a fford to "crash" .
WDOG 1 or WDO G 2 enables the watchdog and sets the interval. WDOG is executed periodically by your
program to prevent the card from resetting. WD OG 0 turn s off the watchd og timer.
Different cards m ay use different time out periods. Refer to your hardw are manu al.
RELATED
none
ERROR
BAD ARGUM ENT when time is out of range
EXAMPLE
The followin g exam ple sho ws how ONTICK can be used to reset th e tim er. The watchdog timer is set for 2.8
seconds.
10 WDOG 2
20 CLEAR TICK(0)
30 ONTICK 2,200
40 GOTO 40
200 PRINT TICK(0)
210 WDOG
220 RETI
When a watchdog timeout occurs, only the CP U is reset. The effect is the same as performing a hardware
reset, except a hardware reset pulse is not issued. Digital I/O at J3 does not change. Digital lines L0 - L8 are
reset to power up conditions as is the display port.
Komentáře k této Příručce