This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Watchdog Resets in Absence of Debugger Breakpoints

Using the uVision2 debugger to simulate code for a Philips P89LPC920 with Watchdog enabled (via UCFG1): The Watchdog feed routine does not reload the Watchdog timer if I attempt to run the code without breakpoints. A Watchdog Reset occurs as a result. If I set a debug breakpoint at or just before the CALL to the Watchdog feed routine (thereby pausing the debugger at that point), the Watchdog reloads just fine when I continue running the program. Very weird. Is there some sort of race condition bug in the Simulator that anybody knows about???

(FYI, my main program loop takes about 30,000 machine cycles and the Watchdog is fed once per loop. I am using the onboard oscillator at 7.373MHz, driving the Watchdog from PCLK instead of the Watchdog oscillator, and using a Watchdog pre-scale factor of 128.) Thanks for any help.

Steve

  • More information: This issue appears to be a bug in the simulator. The workaround I have discovered is to set the Watchdog timer load value high enough to prevent the Watchdog from ever counting down to zero between Watchdog feeds. Even then, it appears that the simulator reloads the Watchdog timer only on EVERY OTHER feed or so. Moreover, the timeout period (e.g. number of milliseconds) shown in the Watchdog peripheral window varies significantly after each successful feed. Given this peculiar behavior, it is probably best to NOT enable the Watchdog in simulator mode since the required Watchdog parameters will likely be different than you would use in your production code.