The programming steps for the watchdog timer are listed in Table: Watchdog Timer Start through Table: Watchdog Timer Interrupt Handler. Table: Watchdog Timer Interrupt Example lists an example of programming the watchdog timer interrupt.
Task |
Register |
Register Field |
Register Offset |
Bits |
Value |
---|---|---|---|---|---|
Enable watchdog timer. |
MODE |
WDEN |
0x00 |
0 |
1 |
Program zero access key. |
MODE |
ZKEY |
0x00 |
23:12 |
12'h0ABC |
Task |
Register |
Register Field |
Register Offset |
Bits |
Value |
---|---|---|---|---|---|
Disable watchdog timer. |
MODE |
WDEN |
0x00 |
0 |
0 |
Program zero access key. |
MODE |
ZKEY |
0x00 |
23:12 |
12'h0ABC |
Task |
Register |
Register Field |
Register Offset |
Bits |
Value |
---|---|---|---|---|---|
Restart watchdog timer. |
RESTART |
RSTKEY |
0x08 |
31:0 |
1999h |
Task |
Register |
Register Field |
Register Offset |
Bits |
Value |
---|---|---|---|---|---|
Notify the application by setting a global variable. |
Task |
Register |
Register Field |
Register Offset |
Bits |
Value |
---|---|---|---|---|---|
Perform self test. Refer to Watchdog Timer Self Test. |
|||||
Set the initial counter restart to the smallest value. Refer to Watchdog Timer Set Control Value. |
|||||
Set the initial divider ratio at the smallest value. Refer to Watchdog Timer Set Control Value. |
|||||
Disable the reset output. Refer to Watchdog Timer Disable Signal Output. |
|||||
Start watchdog timer device. Refer to Watchdog Timer Start. |
|||||
Restart watchdog timer. Refer to Watchdog Timer Restart. |
|||||
Check if watchdog timer is expired. Refer to Check Watchdog Timer Expiry. |
|||||
Stop watchdog timer. Refer to Watchdog Timer Stop. |
|||||
Set up interrupt system. Refer to Watchdog Timer Setup Interrupts. |
|||||
Enable IRQ output. Refer to Watchdog Timer Enable Signal Output. |
|||||
Start watchdog timer device. Refer to Watchdog Timer Start. |
|||||
Restart watchdog timer. Refer to Watchdog Timer Restart. |
|||||
Wait till watchdog timer IRQ handler notification. Refer to Watchdog Timer Interrupt Handler. |
|||||
If no notification is received, |
|||||
Disable interrupts and return failure. |
|||||
Else, if test passed, |
|||||
Restart watchdog timer. Refer to Watchdog Timer Restart. |
|||||
Verify that the watchdog timer does not time out when restarted all the time. |
|||||
Restart watchdog timer. Refer to Watchdog Timer Restart. |
|||||
If more time has passed than it took for it to expire when not restarted in the previous test, then stop the timer. |
|||||
Check if watchdog timer is expired. Refer to Check Watchdog Timer Expiry. |
|||||
If no notification from interrupt handler, disable interrupts and return success. |