Watchdog Timer Functions

Universal Driver Documentation
An overview of the watchdog timer functions is provided here. Full details of the functions are given in the DSCUD Function Reference.

dscWatchdogEnable(DSCB board, WORD wd1, BYTE wd2, SDWORD options)
This function loads the watchdog counters to the specified values and configures the general behavior of watchdog counter 1, and arms the watchdog timer circuit.

dscWatchdogDisable(DSCB board)
This function disables the watchdog timer circuit on the specified board. A previously enabled but subsequently disabled watchdog timer may be re-enabled using the existing configuration by a subsequent call to dscWatchdogTrigger().

dscWatchdogTrigger(DSCB board)
This function retriggers the watchdog timer circuit, causing both counters WD1 and WD2 to be reloaded with their initial values. After a call to dscWatchdogTrigger(), the application has the amount of time specified in WD2 before it must call the function again.

If the watchdog timer has been disabled with a call to dscWatchdogDisable(), than this function will reenable the watchdog timer. It uses the existing watchdog configuration from the last dscWatchdogEnable() call, so any calls to dscWatchdogTrigger() before dscWatchdogEnable() will have undefined results.

In a typical application, dscWatchdogTrigger() is used in a continuous loop to keep retriggering the watchdog timer circuit as evidence that the system is running properly. If the loop ever crashes, or otherwise fails to call dscWatchdogTrigger() in time, the system will reset. The system is configured to automatically restart the application software when it reboots. This way the amount of down time due to a software failure is minimized.


This page was last modified 14:55, 12 Feb 2004.
Copyright (c) 2004 Diamond Systems. All Rights Reserved.