SPRUII0F May 2019 – June 2024 TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S
The watchdog counter (WDCNTR) is reset when the proper sequence is written to the WDKEY register before the 8-bit watchdog counter overflows. The WDCNTR is reset-enabled when a value of 0x55 is written to the WDKEY. When the next value written to the WDKEY register is 0xAA, then the WDCNTR is reset. Any value written to the WDKEY other than 0x55 or 0xAA causes no action. Any sequence of 0x55 and 0xAA values can be written to the WDKEY without causing a system reset; only a write of 0x55 followed by a write of 0xAA to the WDKEY resets the WDCNTR.
Step | Value Written to WDKEY | Result |
---|---|---|
1 | 0xAA | No action |
2 | 0xAA | No action |
3 | 0x55 | WDCNTR is enabled to be reset if next value is 0xAA. |
4 | 0x55 | WDCNTR is enabled to be reset if next value is 0xAA. |
5 | 0x55 | WDCNTR is enabled to be reset if next value is 0xAA. |
6 | 0xAA | WDCNTR is reset. |
7 | 0xAA | No action |
8 | 0x55 | WDCNTR is enabled to be reset if next value is 0xAA. |
9 | 0xAA | WDCNTR is reset. |
10 | 0x55 | WDCNTR is enabled to be reset if next value is 0xAA. |
11 | 0x32 | Improper value written to WDKEY. No action, WDCNTR no longer enabled to be reset by next 0xAA. |
12 | 0xAA | No action due to previous invalid value. |
13 | 0x55 | WDCNTR is enabled to be reset if next value is 0xAA. |
14 | 0xAA | WDCNTR is reset. |
Step 3 in Table 3-8 is the first action that enables the WDCNTR to be reset. The WDCNTR is not actually reset until step 6. Step 8 again re-enables the WDCNTR to be reset and step 9 resets the WDCNTR. Step 10 again re-enables the WDCNTR to be reset. Writing the wrong key value to the WDKEY in step 11 causes no action, however the WDCNTR is no longer enabled to be reset and the 0xAA in step 12 now has no effect.
If the watchdog is configured to reset the device, then a WDCNTR overflow or writing the incorrect value to the WDCR[WDCHK] bits resets the device and sets the watchdog flag (WDRSn) in the reset cause register (RESC). After a reset, the program can read the state of this flag to determine whether the reset was caused by the watchdog. After doing this, the program must clear WDRSn to allow subsequent watchdog resets to be detected. Watchdog resets are not prevented when the flag is set.