A
microcontroller-based device according to the present invention provides a
watchdog timer having an emulator support mode for disabling and reconfiguring time-outs. When the
watchdog timer is placed in the emulator support mode, the
watchdog timer is inhibited from counting. In a disclosed embodiment, the watchdog
timer is inhibited from counting by deasserting a count enable
signal. A watchdog time-out is thus prevented from occurring during the emulator support mode. Also, during the emulator support mode, the watchdog
timer control register is writable, allowing the emulator to disable a watchdog
timer, enable the timer, or program a new time-out value for the timer. The watchdog timer
control register is writable regardless of the state of the enable bit of the timer. Further, in the emulator support mode, a watchdog timer current count becomes readable and writable at a predetermined register address above the watchdog timer
control register subsequent to a write of a write key sequence to the watchdog timer control register. By writing and reading the predetermined register address location, the emulator is able to define and monitor a condition as the watchdog timer is approaching its
timeout value. By monitoring a condition as the watchdog timer approaches its
timeout value, a
software debugger may better predict and appreciate the behavior of a
microcontroller-based device prior to a watchdog time-out. In a disclosed embodiment, the watchdog timer current count is readable and writable through a watchdog timer count high register and a watchdog timer count low register.