Watchdog Timers

pavankukkala

Mar 25, 2014
78
Joined
Mar 25, 2014
Messages
78
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?
 

Colin Mitchell

Aug 31, 2014
1,416
Joined
Aug 31, 2014
Messages
1,416
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:

Minder

Apr 24, 2015
3,561
Joined
Apr 24, 2015
Messages
3,561
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.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
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
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
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?
 

Tha fios agaibh

Aug 11, 2014
2,253
Joined
Aug 11, 2014
Messages
2,253
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.
 

Electromaster

Jul 23, 2015
1
Joined
Jul 23, 2015
Messages
1
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.
 
Top