Wikibooks: Embedded Systems/Watchdog Timer
= Watchdog Timer = In an embedded environment far away from the lab and far away from the programmers engineers and technicians all sorts of things can go wrong and the embedded system needs to be able to fix itself. Remember once you close the box and shrink wrap your product it s hard to get back...
Format: | Book |
---|---|
Language: | English |
Subjects: | |
Online Access: | https://en.wikibooks.org/wiki/Embedded_Systems/Watchdog_Timer |
id |
ftwikibooks:enwikibooks:58283:297363 |
---|---|
record_format |
openpolar |
spelling |
ftwikibooks:enwikibooks:58283:297363 2023-12-31T10:01:09+01:00 Wikibooks: Embedded Systems/Watchdog Timer https://en.wikibooks.org/wiki/Embedded_Systems/Watchdog_Timer eng eng Book ftwikibooks 2023-12-02T18:08:17Z = Watchdog Timer = In an embedded environment far away from the lab and far away from the programmers engineers and technicians all sorts of things can go wrong and the embedded system needs to be able to fix itself. Remember once you close the box and shrink wrap your product it s hard to get back in there and fix your mistakes. In a typical computer systems cosmic rays flip a bit of RAM about once a month fact . If that happens to the wrong bit the program can hang stuck in a short infinite loop. Turning the power off then on again gets it unstuck. But how do you jiggle the power switch when you are in Paris and your embedded system is in Antarctica? Or you are on Earth and your embedded system is near Neptune? One of the most important tools of an embedded systems engineer is the Watch Dog Timer (WDT). A WDT is a timer with a very long fuse (several seconds usually). The WDT counts down toward zero( ) like the big red numbers counting down on the bombs in the movies. Left to itself eventually the counter will reach zero. When the counter reaches zero the WDT resets the microcontroller (as if the power were turned off then turned back on). When the system is running normally you don t want it to randomly reset itself so you need to make sure that your program always feeds the watch dog long before time runs out. Good practice is to reset the WDT less than halfway through its countdown. For instance if the WDT has a timer of 20 seconds then you will want to feed the WDT at least once every 10 seconds. Unlike when our hero deals with bombs in the movies feeding the watch dog doesn t stop the countdown. When the code uses a reset or clear command to feed the watchdog it merely sets the WDT back to some large number and then the watchdog timer immediately starts counting down from there. If the programmer fails to feed the watchdog in time or if the program hangs for any reason then sooner or later WDT will time out and the program will reset hopefully getting your system unstuck. Some multi stage watchdogs have a ... Book Antarc* Antarctica WikiBooks - Open-content textbooks |
institution |
Open Polar |
collection |
WikiBooks - Open-content textbooks |
op_collection_id |
ftwikibooks |
language |
English |
description |
= Watchdog Timer = In an embedded environment far away from the lab and far away from the programmers engineers and technicians all sorts of things can go wrong and the embedded system needs to be able to fix itself. Remember once you close the box and shrink wrap your product it s hard to get back in there and fix your mistakes. In a typical computer systems cosmic rays flip a bit of RAM about once a month fact . If that happens to the wrong bit the program can hang stuck in a short infinite loop. Turning the power off then on again gets it unstuck. But how do you jiggle the power switch when you are in Paris and your embedded system is in Antarctica? Or you are on Earth and your embedded system is near Neptune? One of the most important tools of an embedded systems engineer is the Watch Dog Timer (WDT). A WDT is a timer with a very long fuse (several seconds usually). The WDT counts down toward zero( ) like the big red numbers counting down on the bombs in the movies. Left to itself eventually the counter will reach zero. When the counter reaches zero the WDT resets the microcontroller (as if the power were turned off then turned back on). When the system is running normally you don t want it to randomly reset itself so you need to make sure that your program always feeds the watch dog long before time runs out. Good practice is to reset the WDT less than halfway through its countdown. For instance if the WDT has a timer of 20 seconds then you will want to feed the WDT at least once every 10 seconds. Unlike when our hero deals with bombs in the movies feeding the watch dog doesn t stop the countdown. When the code uses a reset or clear command to feed the watchdog it merely sets the WDT back to some large number and then the watchdog timer immediately starts counting down from there. If the programmer fails to feed the watchdog in time or if the program hangs for any reason then sooner or later WDT will time out and the program will reset hopefully getting your system unstuck. Some multi stage watchdogs have a ... |
format |
Book |
title |
Wikibooks: Embedded Systems/Watchdog Timer |
spellingShingle |
Wikibooks: Embedded Systems/Watchdog Timer |
title_short |
Wikibooks: Embedded Systems/Watchdog Timer |
title_full |
Wikibooks: Embedded Systems/Watchdog Timer |
title_fullStr |
Wikibooks: Embedded Systems/Watchdog Timer |
title_full_unstemmed |
Wikibooks: Embedded Systems/Watchdog Timer |
title_sort |
wikibooks: embedded systems/watchdog timer |
url |
https://en.wikibooks.org/wiki/Embedded_Systems/Watchdog_Timer |
genre |
Antarc* Antarctica |
genre_facet |
Antarc* Antarctica |
_version_ |
1786795996190081024 |