156
OpenWatchDog
Type
Subroutine
Invocation
OpenWatchDog(timeout)
Parameter
Method
Type
Description
timeout
ByVal
Byte
Specifies a timeout value (see discussion).
Discussion
This subroutine prepares the watchdog timer for use. Once it is opened, the WatchDog() routine must
be called from time to time. If the period between WatchDog() calls exceeds the timeout value, the
system will be reset.
The timeout value is 16.384 milliseconds times 2 to the N power where N is the value of the timeout
parameter limited to the range shown in the table below. Note that the timeout value varies with
processor voltage. It is slightly longer at 3.0 volts than at 5.0 volts. Consult the Atmel documentation for
more specific information.
ZX Models
Timeout Range
ZX-24, ZX-40, ZX-44
0-7
2 sec
ZX-24a, ZX-40a, ZX-44a,
ZX-24p, ZX-40p, ZX-44p,
ZX-24n, ZX-40n, ZX-44n
0-9
8 sec
ZX-1281, ZX-1281n, ZX-1280, ZX-1280n
0-9
8 sec
ZX-24e, ZX-128e
0-7
2 sec
ZX-24ae, ZX-1281e
0-9
8 sec
When the processor is reset, the register value Register.ResetFlags contains bit flags indicating the
source of the reset. It is important to note that the occurrence of a system fault (e.g. a stack overflow) will
Checking in the ZBasic Reference Manual for more information on stack overflow detection.
Compatibility
See Also