6.1.2 Watchdog Timer Functions

An overview of the watchdog timer functions is provided here. Full details of the functions are given in the UD 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.

dscWatchdogConfig(DSCB board, DSCWATCHDOG* watch)

This function configures watchdog timer for desired operation and it does not enables the watch timer, the function dscWatchDogEnable () must be called to enable watch dog timer.

Last updated