Navigation bar
  Start Previous page
 165 of 283 
Next page End 160 161 162 163 164 165 166 167 168 169 170  

156
OpenWatchDog
Type
Subroutine
Invocation
OpenWatchDog(timeout)
Parameter
Method
Type
Description
timeout
ByVal
Byte
Specifies a timeout value (see discussion).
Discussion
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.
WatchDog Timeout Parameter Range
ZX Models
Timeout Range
Max. Time
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
also cause a WatchDog reset as will calling ResetProcessor().  See the section on Run Time Stack
Checking in the ZBasic Reference Manual for more information on stack overflow detection.
The watchdog timer can be turned off using CloseWatchDog.
Compatibility
BasicX doesn’t support Register.ResetFlags or CloseWatchDog.
See Also
Previous page Top Next page