Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/15/07 20:41
Read: times


 
#135064 - Be kind to animals
Responding to: ???'s previous message
Jez said:
I was discussing with someone at work where in the code you reset the watchdog timer, I have always been of the opinion that you only do it in the main loop, he was suggesting that you do it in the main loop and in the ISRs and anywhere else you can think of which seems to defeat the object somewhat.

You're right. Your pal is wrong. You should kick the dog in as few places as you can get away with, and never inside an ISR if you can avoid it. If you kick the dog in the ISR for a timer interrupt, for example, it's entirely possible that the main loop can go off in the weeds while the timer and its interrupt continue to run normally. If the timer ISR is kicking the dog, then the watchdog reset will never occur and your gizmo will be hung as surely as if you had the watchdog disabled entirely.

-- Russ


List of 23 messages in thread
TopicAuthorDate
Where to kick the watchdog            01/01/70 00:00      
   Not being the consummate embedded guy, ...            01/01/70 00:00      
   Be kind to animals            01/01/70 00:00      
      I thought that as well, stray main loop =badness            01/01/70 00:00      
      Sort of            01/01/70 00:00      
   There are watchdogs and the there are WATCHDOGS            01/01/70 00:00      
   I doubt the usefulness of normal watchdog            01/01/70 00:00      
      watchdog IS expensive...            01/01/70 00:00      
         i suppose arguments for and against having a dog            01/01/70 00:00      
            bugs happen...            01/01/70 00:00      
               Not having quite the same budget as NASA            01/01/70 00:00      
                  the case for the internal dog            01/01/70 00:00      
   It's obvious I need to learn about WDT            01/01/70 00:00      
      the WD would not care, but if you reset it in e.g.            01/01/70 00:00      
      if your main function goes of to play in the weeds            01/01/70 00:00      
      I wouldn't have thought about that.            01/01/70 00:00      
         one more reason to KISS            01/01/70 00:00      
      there is nothing like "frozen" microcontroller...            01/01/70 00:00      
         You would be surprised...            01/01/70 00:00      
            Apply ESD to your micro and look what happens...            01/01/70 00:00      
            I am not surprised...            01/01/70 00:00      
               be reasonable            01/01/70 00:00      
                  therac            01/01/70 00:00      

Back to Subject List