Because the architects of the TMS320C5515 have chosen to clock the Watchdog Timer from the System Clock and to gate that clock using the same PCGCR1 bit as Timer2, in systems that are put into IDLE3 deep sleep:
1) In PCGCR1, during sleep the SYSCLKDIS and TMR2CG bits must remain 0 to provide clocking to the watchdog timer.
2) During the time when the PLL is bypassed during deep sleep, thereby slowing down the System Clock, the prescaler factor of the Watchdog Timer should be reduced proportionally.
This raises an important question:
1) Under what conditions is the Watchdog Prescaler counter loaded from the WDPS register?
If the Watchdog Timer is already running and WDPS is written with a new value,
a) will the Watchdog Prescaler's counter be immediately loaded from WDPS, or
b) will it wait until the Watchdog Prescaler counter reaches zero?
(The latter could be an inordinately long wait when the PLL has been bypassed. My experience seems to hint that this is the case.)
I have several other related questions for which I have failed to find specifics in TMS320C5515/14/05/04/VC05/VC04 DSP Timer/Watchdog Timer User's Guide (SPRUFO2):
2) Does the Watchdog Prescaler's counter remain 0 one full SYSCLK cycle before rolling over, in which case the period of the clock fed to the Watchdog Timer counter is tSYSCLK * (WDPS +1)?
3) What happens if WDPS = 0? (Is a 1/2 SYSCLK cycle clock pulse sent to the Watchdog Prescaler counter at every SYSCLK cycle, i.e. divide fSYSCLK by 1?)
4)What happens if WDSVR = 0?
a) Will the Watchdog Timer generate a hardware reset as soon as the Watchdog is enabled or
b) will it count 65536 times before again reaching zero and generating the hardware reset?
5) Does the Prescaler / Counter chain begin operation as soon as bit[0] of the WDEN register is set?
The User's Guide (SPRUFO2) says that the Kick register must be unlocked and written to start the Watchdog Timer,
but cls_wdt_example.c, which calls functions in cls_wdt.c, does not appear to write to the Kick Register at the outset.
(In a test version of my code, the watchdog runs without ever writing to the Kick Register.)