# Using a watchdog in low power application?

Most low-power applications operate in burst mode, where the system is asleep most of the time.
I don't understand how to use a watchdog (WD) in those kinds of systems.

The perfect scenario would be to wake up periodically to reset my MCU's internal WD.
The problem: internal WDs are too energy expensive (usually more than 1uA) to use while sleeping. (Assuming a CR2032 coin cell battery as a power source).

What are the strategies to use a WD in a low power system?
Use a specialized IC?
Enable WD at wakeup?

• Internal WD is simple oscilator with counter a little logic only, so it draw very close to as litle as possible. You have option to make external low power oscilator and wake according to it using some sleep active pin of MCU. Apr 4 at 14:42
• Are you looking at run-of-the-mill microcontrollers, or at specially-designed low-power microcontrollers? Apr 4 at 14:44
• @MichalPodmanický "so it draw very close to as litle as possible" In my experience, they are rarely lower than 1uA. When they are, like for the STM8L51, the datasheet mentions typical value not tested in production. Apr 4 at 15:03
• @Hearth Specially designed. If you have any suggestion. let me know. Apr 4 at 15:03
• What is your power source? Apr 4 at 22:30

The watchdog has the task to monitor code execution and possibly to reset the CPU.

When the CPU is stopped, there's no reason for the watchdog to work or to be awaken.

• What about a situation where a problem would trigger unwanted endless sleep? Apr 6 at 18:46
• In this case you need an external ultra low power watchdog timer like Texas Instruments TPL5010 Nano-Power System Timer With Watchdog. Apr 6 at 21:35

You don't say what processor you are using but I have used the WD timer in an AVR for performing the processor wake-up.

Here is a section of my code that goes to sleep to be awakened by the WD timer reset.

When the WD expires the processor is reset and wakes up, it configures the processor as with a normal reset and disables the WD (if you wish to use the WDT to monitor your code you could leave it enabled but configure it for the timing you need during execution).

After performing the required operations it enables and configures the WD timer for the required sleep time, turns off the various peripherals not needed during sleep then sets the WD timer for a later wake up. It then goes into an infinite loop (that will never execute) until the next reset.

Although a similar behaviour can be obtained using the normal timers they require that the clocks be operating and as such the quiescent current of the system is usually much higher even if using the low power internal RC clock (varies with processor).

The power consumption during sleep was about 20-30uA in my design although just the processor itself with WD timer takes about 3uA at normal temperatures. This would be about 5 or 6 years when powered from a CR2032 lithium cell.

void power_down(void){
cli();
bit_dir_inp(LED1);          // Disable LED