This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can Interrupt be Servied even when Micro controller hangs??

Hi Frnds,

Can a Interrupt Service Routine be serviced even when Micro controller hangs for undue reasons??

what is a hang in Microcontroller means????

Parents
  • But my question is then the whole theory of watchdog timer fails.., even when system is hanged , it keeps servicing watchdog timer from Interrupt.

    How is this possible to service watchdog timer without timer interrupt????

    Then what is a critical Micro controller hang????

Reply
  • But my question is then the whole theory of watchdog timer fails.., even when system is hanged , it keeps servicing watchdog timer from Interrupt.

    How is this possible to service watchdog timer without timer interrupt????

    Then what is a critical Micro controller hang????

Children
  • "But my question is then the whole theory of watchdog timer fails ... it keeps servicing watchdog timer from Interrupt."

    That is precisely why you should not service the watchdog in a timer interrupt!

    "Then what is a critical Micro controller hang????"

    Are you using an internal (on-chip) watchdog within your microcontroller?

  • Thanx for u kind reply.

    I am servicing watchdog timer in Interrupt, I am using a External watchdog timer, Max691 where it has to be serviced within 1.5secs , so how is this programmed if at all watchdog timers should not be serviced in interrupt????

  • "I am servicing watchdog timer in Interrupt"

    And now you know why that's a really bad idea!
    (but see below)

    The idea is that the Watchdog should be restarted if and only if the software is running correctly.

    Therefore, you should put your Watchdog restarts at a point in your code that is always reached when it's running properly, but won't be reached if anything hangs.

    Typically, this would be in your main loop.

    If you do have some operations that you know can take longer than the watchdog interval, you will have to either split them, or think of some solution.

    One way to extend the watchdog period does use an interrupt:
    Instead of restarting the watchdog directly, your main code restarts a global counter variable;
    The timer interrupt then decrements the variable, and only restarts the watchdog if it is above some limit...

    www.ganssle.com/watchdogs.pdf
    www.ganssle.com/.../tem105.pdf

  • Thanx andy.,

    i will go through the document and find som solution for watchdog timer..,