« Close

Datasheets and User Guides

App Notes

Software & Driver

 

23.0 Watchdog

The Watchdog system can perform various actions if the T7 does not receive any communication within a specified timeout period.

A typical usage is to first use the IO Config system to set the power-up defaults for everything as desired, and then configure the watchdog to reset the device on timeout.  For example, consider a software program that enables the watchdog to reset the T7 with a 60 second timeout, and then the software has a loop that talks to the device once per second.  If something goes wrong with the software, or some other problem that causes communication to stop, the T7 will reset every 60 seconds until communication resumes.

The watchdog timeout can be set as low as 1 second, but such a low value is usually not a good idea.  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 (FIO2 <=> SPC).

The timeout period is reset when a response to a command-response packet is sent to the host. Alternatively, "strict" mode can be enabled. When strict mode is enabled the timeout period is reset by writing the key value to WATCHDOG_STRICT_CLEAR. The key can be set by writing WATCHDOG_STRICT_KEY_DEFAULT. While strict is disabled writing any value to WATCHDOG_STRICT_CLEAR will clear the watchdog. Note that writing to WATCHDOG_STRICT_CLEAR will clear the watchdog when the write is processed, not when a response packet is sent.

 

Register Listing

Watchdog Registers
Name Start Address Type Access
WATCHDOG_ENABLE_DEFAULT 61600 UINT32 R/W
WATCHDOG_ADVANCED_DEFAULT 61602 UINT32 R/W
WATCHDOG_TIMEOUT_S_DEFAULT 61604 UINT32 R/W
WATCHDOG_STARTUP_DELAY_S_DEFAULT 61606 UINT32 R/W
WATCHDOG_STRICT_ENABLE_DEFAULT 61610 UINT32 R/W
WATCHDOG_STRICT_KEY_DEFAULT 61612 UINT32 R/W
WATCHDOG_STRICT_CLEAR 61614 UINT32 W
WATCHDOG_RESET_ENABLE_DEFAULT 61620 UINT32 R/W
WATCHDOG_DIO_ENABLE_DEFAULT 61630 UINT32 R/W
WATCHDOG_DIO_STATE_DEFAULT 61632 UINT32 R/W
WATCHDOG_DIO_DIRECTION_DEFAULT 61634 UINT32 R/W
WATCHDOG_DIO_INHIBIT_DEFAULT 61636 UINT32 R/W
WATCHDOG_DAC0_ENABLE_DEFAULT 61640 UINT32 R/W
WATCHDOG_DAC0_DEFAULT 61642 FLOAT32 R/W
WATCHDOG_DAC1_ENABLE_DEFAULT 61650 UINT32 R/W
WATCHDOG_DAC1_DEFAULT 61652 FLOAT32 R/W
WATCHDOG_ENABLE_DEFAULT
- Address: 61600
Write a 1 to enable the watchdog or a 0 to disable. The watchdog must be disabled before writing any of the other watchdog registers (except for WATCHDOG_STRICT_CLEAR).
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_ADVANCED_DEFAULT
- Address: 61602
A single binary-encoded value where each bit is an advanced option. If bit 0 is set, IO_CONFIG_SET_CURRENT_TO_FACTORY will be done on timeout. If bit 1 is set, IO_CONFIG_SET_CURRENT_TO_DEFAULT will be done on timeout.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_TIMEOUT_S_DEFAULT
- Address: 61604
When the device receives any communication over USB/Ethernet/WiFi, the watchdog timer is cleared. If the watchdog timer is not cleared within the timeout period, the enabled actions will be done.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_STARTUP_DELAY_S_DEFAULT
- Address: 61606
This specifies the initial timeout period at device bootup. This is used until the first time the watchdog is cleared or timeout ... after that the normal timeout is used.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_STRICT_ENABLE_DEFAULT
- Address: 61610
Set to 1 to enable strict mode.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_STRICT_KEY_DEFAULT
- Address: 61612
When set to strict mode, this is the value that must be written to the clear register.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_STRICT_CLEAR
- Address: 61614
When running in strict mode, writing the key to this register is the only way to clear the watchdog. Writing to this register while not using strict mode will clear the watchdog.
  • Data type: UINT32  (type index = 1)
  • Write-only
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_RESET_ENABLE_DEFAULT
- Address: 61620
Timeout action: Set to 1 to enable device-reset on watchdog timeout.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_DIO_ENABLE_DEFAULT
- Address: 61630
Timeout action: Set to 1 to enable DIO update on watchdog timeout.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_DIO_STATE_DEFAULT
- Address: 61632
The state high/low of the digital I/O after a Watchdog timeout. See DIO_STATE
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_DIO_DIRECTION_DEFAULT
- Address: 61634
The direction input/output of the digital I/O after a Watchdog timeout. See DIO_DIRECTION
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Minimum firmware version: 1.0016
WATCHDOG_DIO_INHIBIT_DEFAULT
- Address: 61636
The inhibit mask of the digital I/O after a Watchdog timeout. See DIO_INHIBIT
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_DAC0_ENABLE_DEFAULT
- Address: 61640
Timeout action: Set to 1 to enable DAC0 update on watchdog timeout.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_DAC0_DEFAULT
- Address: 61642
The voltage of DAC0 after a Watchdog timeout.
  • Data type: FLOAT32  (type index = 3)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_DAC1_ENABLE_DEFAULT
- Address: 61650
Timeout action: Set to 1 to enable DAC1 update on watchdog timeout.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016
WATCHDOG_DAC1_DEFAULT
- Address: 61652
The voltage of DAC1 after a Watchdog timeout.
  • Data type: FLOAT32  (type index = 3)
  • Readable and writable
  • Default value: 0
  • Minimum firmware version: 1.0016

 

 

Example

The most common way to use Watchdog is to write:

WATCHDOG_ENABLE_DEFAULT=0
WATCHDOG_TIMEOUT_S_DEFAULT=60
WATCHDOG_RESET_ENABLE_DEFAULT=1
WATCHDOG_ENABLE_DEFAULT=1

If the device does not receive any communication for 60 seconds, the watchdog will cause the device to reset.  So if nothing is talking to the device, it will reset every 60 seconds.  In conjunction you would often use the IO Config system to configure the power-up defaults as desired.

 

4 comments

This does not match the behavior of the device.

"WATCHDOG_OPTIONS_DEFAULT" does not exist (attempts to command by that name lead to failure).  Looking at the file "ljm_constants.json", it appears that address 61602 actually goes by the name "WATCHDOG_ADVANCED_DEFAULT". Are the same option bits relevant there? 

I tried that but... no joy.  Also noticed that one must set WATCHDOG_ENABLE_DEFAULT to 0 before attempting to set the other params (otherwise one gets a different error).  However, after setting that back to 1 I still do not get the expected timeout behavior.

(I want DAC0 and DAC1 to revert to zero volts after 3 seconds of no comms.)

Help?

 

"WATCHDOG_OPTIONS_DEFAULT" was an old name/address. The option bits now have their own name/address. "WATCHDOG_ADVANCED_DEFAULT" is not the same as "WATCHDOG_OPTIONS_DEFAULT", and is currently reserved for future use. We have updated this page to show the current Watchdog settings available.

As for values to set, you do need to disable the Watchdog first before changing its settings as demonstrated in the examples. As for setting DAC0 and DAC1 to zero after a 3 second timeout, the settings would look like this:

WATCHDOG_ENABLE_DEFAULT=0
WATCHDOG_TIMEOUT_S_DEFAULT=3
WATCHDOG_RESET_ENABLE_DEFAULT=0
WATCHDOG_DAC0_ENABLE_DEFAULT=1
WATCHDOG_DAC0_DEFAULT=0.0
WATCHDOG_DAC1_ENABLE_DEFAULT=1
WATCHDOG_DAC1_DEFAULT=0.0
WATCHDOG_ENABLE_DEFAULT=1

Thank you, this makes more sense now.

Not to be a pest, but...

Is there any chance the Kipling watchdog display could be filled out to reflect all of the parameters?  Right now that display shows 9 of the 16 values, with no apparent pattern as to was was selected for display.  For example DAC0 settings are displayed, but DAC1 are not.

 

I used the Kipling version (1.0.11) from the latest installer (2014.1.23) and it displays 12 of the settings by default which includes the DAC1 settings. The Watchdog tab displays the common settings by default which excludes the "STRICT" and "ADVANCED" settings. To add undisplayed names/addresses in Kipling, go to Tools->Add Register... in the menu and you will get a window with a list of all the names/addresses you can add to the display.

As for DAC1 not displaying, make sure you are using the latest Windows installer and

Make sure you have the latest Windows software and T7 firmware, and see if that helps.