cancel
Showing results for 
Search instead for 
Did you mean: 

WatchDog Implementation on STM32F0 Discovery

wbarkley
Associate II
Posted on September 27, 2012 at 15:25

What is the best way to implement a watch dog timer in my program?

How many different types of watchdogs are there?  Which is best to use?
4 REPLIES 4
raptorhal2
Lead
Posted on September 27, 2012 at 16:25

That depends on what the dog is watching. Is it an external analog or discrete signal, an internal data value, or an elapsed time, or ........?

Cheers, Hal

wbarkley
Associate II
Posted on September 27, 2012 at 16:55

Most likely just a program tick/timer/heartbeat.

Posted on September 27, 2012 at 17:13

You have the IWDG and WWDG.

You generally don't want to kick them under interrupt.

If you have multiple tasks, you could use a score-board variable which each task tickles, and then have the idle task check that periodically, and kick the HW watchdog.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
wbarkley
Associate II
Posted on October 01, 2012 at 15:01

Ok, I will use the WWDG.

Looking for some clarification on the Prescaler and Window Value functions.

For SetPrescaler, the WWDG counter clock is based off of PCLK1.  Which one of these for are typically used.  I was going to kick the dog inside my 10 ms timer increment code.  Does this determine which of the four I end up using? 

For the set window function, it says it must be set lower the 0x80.  So I set this at 0x79 so I wont have problems?