Skip to main content
Skip table of contents

23.0 Watchdog [T-Series Datasheet]

Overview

The Watchdog system can perform various actions if the T-Series device does not receive any communication within a specified timeout period. Actions include:

  • Reset/restart the device
  • Set DIO
  • Set DAC0/DAC1
  • Reset IO configs

Example: Reset after no communication for 60 seconds

The most common way to use Watchdog is to write:

WATCHDOG_ENABLE_DEFAULT=0        // Disable the Watchdog
WATCHDOG_TIMEOUT_S_DEFAULT=60    // Set the timeout in seconds
WATCHDOG_RESET_ENABLE_DEFAULT=1  // Enable reset upon timeout
WATCHDOG_ENABLE_DEFAULT=1        // Enable the Watchdog

With this configuration, the Watchdog will cause the device to reset if it does not receive any communication for 60 seconds. In other words, if nothing is talking to the device, it will reset every 60 seconds.

Use the IO Config system to configure the power-up defaults as desired.

Basic Usage

A typical usage is to use the IO Config system to set the power-up defaults as desired, then configure the Watchdog to reset the device on timeout.

Write 0 to WATCHDOG_ENABLE_DEFAULT to disable the Watchdog while setting Watchdog configurations. Write 1 to it to enable the Watchdog:

Use WATCHDOG_TIMEOUT_S_DEFAULT to set the timeout in seconds:

The timeout period is reset when a response to a command-response packet is sent to the host, except when strict mode is enabled (see below).

In addition to enabling the Watchdog and setting a timeout, the Watchdog needs to be configured to take an action when the timeout is complete.

Actions

Most applications will simply need the Watchdog to reset the device. Use WATCHDOG_RESET_ENABLE_DEFAULT to enable device reset:

To set DIO upon timeout, set the following configurations:

To set DAC0 or DAC1 upon timeout, set the following configurations:

To reset IO configs, set the following advanced configuration:

Short Timeouts

The Watchdog timeout can be set as low as 1 second—but such a low value can prevent the device from communicating if reset is enabled. For example, when a USB device resets it takes a little time for USB to re-enumerate and software to be able to talk to the device again, so you could get in a situation where the device keeps resetting so often that you can't start talking to it again. This might require using the reset-to-factory jumper—see 11.0 SPC for details.

Strict Mode

The default timeout period is reset when a response to a command-response packet is sent to the host. Alternatively, "strict" mode can be enabled using WATCHDOG_STRICT_ENABLE_DEFAULT:

When strict mode is enabled, the timeout period is reset by writing the key value to WATCHDOG_STRICT_CLEAR:

To set the key, write to WATCHDOG_STRICT_KEY_DEFAULT:

When strict mode is disabled, writing any value to WATCHDOG_STRICT_CLEAR will clear the Watchdog.

Writing to WATCHDOG_STRICT_CLEAR will clear the Watchdog when the write is processed, not when a response packet is sent.

When Using Stream

Normal spontaneous stream data does not reset the Watchdog timeout. Write periodic command-response communication to reset the Watchdog timeout. For the difference between command-response and stream, see the Communication section.

Startup Delay

To set an initial delay, use WATCHDOG_STARTUP_DELAY_S_DEFAULT:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.