Connect with us

Watchdog Timers

Discussion in 'General Electronics Discussion' started by pavankukkala, Jul 22, 2015.

Scroll to continue with content
  1. pavankukkala

    pavankukkala

    78
    0
    Mar 25, 2014
    Hi friends,
    Can anybody say me exactly what is the difference between Hardware Watch dog timer and Software watch dog Timer, and how can we control the watch dog timer with our programming?
     
  2. Colin Mitchell

    Colin Mitchell

    1,418
    314
    Aug 31, 2014
    You can design a circuit that has to be triggered every 1mS so that it resets. If it is not reset, it reset the microcontroller. This is a HARDWARE WATCHDOG
    Most microcontrollers have an inbuilt watchdog that must be rest on a regular basis. This is called SOFTWARE WATCHDOG TIMING
     
    Last edited: Jul 22, 2015
    pavankukkala likes this.
  3. pavankukkala

    pavankukkala

    78
    0
    Mar 25, 2014
    Then what is the software watch dog timer
     
  4. Arouse1973

    Arouse1973 Adam

    5,164
    1,080
    Dec 18, 2013
    Colin, just told you above?
     
  5. Minder

    Minder

    2,948
    623
    Apr 24, 2015
    To me a hardware WD or charge pump is a circuit external to the main controller and can involve hardware in the form of relay etc used to control external devices, this monitors the state of the main control where a pulse or signal is sent to the external HW WD.
    The S/W WD is one that is used internally by the controller itself and is purely S/W in nature and does not directly control any external device.
    I know this is a general description, but what I have used in a practical sense.
    Both monitor the health of the controller.
    M.
     
  6. BobK

    BobK

    7,680
    1,685
    Jan 5, 2010
    Please explain what you mean be a software watchdog timer. I think this is a contradiction of terms. A watchdog timer is used to catch runaway software by making certain that the software checks in within a settable interval. You cannot do this with software. Once the software goes into a loop like;

    lab:
    goto lab

    There is nothing but hardware that can interrupt it.

    Bob
     
  7. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    I guess it would depend on the architecture...
    Software watchdogs can function if they are running in parallel with the main process... but this is wasteful, as the additional core that could be doing something useful is simply waiting for the other core to stop responding instead... Some microcontrollers have dedicated Watch-dog circuits integrated, which can be configured in software.
    I tend to view 'software' watchdog as a watchdog that can be implemented in the chip itself, and a hardware watchdog that requires additional hardware to operate...


    Now... trick question.
    If you have two microprocessors working in tandem to complete a task that periodically check the other, would this be considered software or hardware?
     
  8. Tha fios agaibh

    Tha fios agaibh

    2,088
    699
    Aug 11, 2014
    Another words, if the timer is executed with software, it's a software watchdog.

    Bob makes a good point, that (external) hardware should decern wither or not the software is functioning properly. But a (internal) software watchdog is also useful to verify that a program or portion of a program has executed.
    In a critical application I would opt for a hardware watchdog.
     
  9. Electromaster

    Electromaster

    1
    0
    Jul 23, 2015
    Simply WDT in its software version is just a continuously decremented value that resets when every single istruction has been processed. Let's say you have a task to do, and you only have 1 minute to finish the task. A timer will be set at 1 minute decreasing the value by 1 second. If you manage to finish your task within the 1 minute time, the timer resets and again you repeat everything by doing another task. Now if your time is up, the WDT will sed a message "instruction" to you saying "sleep, you are not doing anything, don't waste your energy".


    And of course to answer your question:
    the software WDT is just a register in the program memory of almost all microcontrollers that has a decrementing value when the microcontroller starts doing its instructions. Now, if by mistake an instruction is taking so long, basically longer than the preset value of the WDT, the next instruction is to but the microcontroller to sleep to lower power consumption. In some microcontroller, the instruction implemented after the WDT time is up can be set by the programmer. If a simple circuit containing a button, LCD and an LED with the microcontroller, the microcontroller program reads button input and print atext on the lcd "LED is on", lights the LED and waits for 2 seconds. If the other cycle has no button input for too long, the programmer can ad a line to the program to print "time up" on the LCD.



    I hope this answers your question.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-