Skip to main content
wbarkley
Associate III
September 27, 2012
Question

WatchDog Implementation on STM32F0 Discovery

  • September 27, 2012
  • 4 replies
  • 981 views
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?
    This topic has been closed for replies.

    4 replies

    raptorhal2
    Lead
    September 27, 2012
    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
    wbarkleyAuthor
    Associate III
    September 27, 2012
    Posted on September 27, 2012 at 16:55

    Most likely just a program tick/timer/heartbeat.

    Tesla DeLorean
    Guru
    September 27, 2012
    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 VenmoUp vote any posts that you find helpful, it shows what's working..
    wbarkley
    wbarkleyAuthor
    Associate III
    October 1, 2012
    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?