# WATCHDOG

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
WATCHDOG timeout | OFF

Description:
Starts the watchdog timer which will automatically restart the processor when it has timed out.
This can be used to recover from some event that disabled the running program (such as an endless loop or a programming or other error that halts a running program).
This can be important in an unattended control situation.
'timeout' is the time in milliseconds (ms) before a restart is forced.
This command should be placed in strategic locations in the running BASIC program to constantly reset the watchdog timer and therefore prevent it from counting down to zero.
If the timer count does reach zero (perhaps because the BASIC program has stopped running) the Maximite will be restarted and the automatic variable MM.WATCHDOG will be set to true (ie, 1) indicating that an error occurred.
On a normal startup MM.WATCHDOG will be set to false (ie, 0).
WATCHDOG OFF will disable the watchdog timer (this is the default on a reset or power up). The timer is also turned off when the break character (normally CTRL-C) is used on the console to interrupt a running program.

Last edited: 29 September, 2020