Author Topic: WatchDog patting techniques.  (Read 3402 times)

0 Members and 1 Guest are viewing this topic.

Offline firewalkerTopic starter

  • Super Contributor
  • ***
  • Posts: 2450
  • Country: gr
WatchDog patting techniques.
« on: December 15, 2011, 08:55:52 pm »
Is it "bad" to pat the dog from a timer interrupt routine?

Alexander.
Become a realist, stay a dreamer.

 

Offline Rudolfo

  • Contributor
  • Posts: 30
Re: WatchDog patting techniques.
« Reply #1 on: December 15, 2011, 09:24:22 pm »
Hello Alexander,

the micro should receive an interrupt from an external independent watchdog (like a monoflop), if it can't restart the watchdog before the timeout is reached. Thus the micro must run a restart software routine triggered by an internal timer. Sometimes there is a second watchdog which resets the micro if the interrupt did not start the routine.

Enjoy the day
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: WatchDog patting techniques.
« Reply #2 on: December 15, 2011, 09:43:16 pm »
Is it "bad" to pat the dog from a timer interrupt routine?

If that is all you do then yes it is bad because the foreground code could hang without causing a watchdog time out.

A simple solution is to maintain a counter in the timer interrupt which counts down to zero and re-trigger the watchdog only while the counter is non-zero. Foreground code can regularly set the count to some appropriate value.  You can extend the idea with multiple counters which can ensure different sections of foreground code and even other interrupt handlers run regularly.

 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 3717
  • Country: us
Re: WatchDog patting techniques.
« Reply #3 on: December 15, 2011, 10:46:13 pm »
Unless your entire program runs from the interrupt routine putting the watchdog reset there is probably not very helpful.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf