Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Watchdog timer
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Electronic watchdogs=== Electronic WDTs are usually implemented either as a stand-alone [[integrated circuit]] (IC) or as part of a more complex IC. Some stand-alone implementations contain only a WDT, whereas others bundle a WDT with other functions (e.g. [[supply voltage supervisor]]s) in a common IC. Many microcontrollers have a watchdog "module" consisting of a digital WDT and mechanisms for controlling and monitoring the WDT. Such modules typically include related control and status registers, circuitry for qualifying restart triggers ("kicks"), and routing control logic for the timeout signal. Some microcontrollers provide an analog WDT in lieu of a digital WDT. For example, Texas Instruments' TMS470 microcontroller has an analog WDT that employs an external capacitor and resistor to program the watchdog interval.<ref name="TMS470"/> ====Digital watchdogs==== In microcontrollers and other complex digital ICs, a digital WDT is typically instantiated by synthesizing it from a description written in [[VHDL]], [[Verilog]] or some other [[hardware description language]]. For example, the following VHDL code describes a simple WDT: <syntaxhighlight lang="VHDL" class="skin-invert"> entity watchdog_timer is port ( CLK : in std_logic; -- clock INIT : in std_logic; -- initialize watchdog KICK : in std_logic; -- restart timer INTERVAL : in unsigned(31 downto 0); -- timer interval in clocks TIMEOUT : out std_logic; -- timeout indicator ); end watchdog_timer; architecture behavioral of watchdog_timer is process(CLK) variable elapsed : std_logic; -- timeout register variable counter : unsigned(31 downto 0); -- remaining clocks until timeout begin if rising_edge(CLK) then -- upon rising clock edge if INIT = '1' then -- if watchdog is being initialized counter <= INTERVAL; -- start timer elapsed <= '0'; -- reset timeout indicator elsif counter = 0 then -- else if watchdog interval has elapsed elapsed <= '1'; -- indicate timeout; timer is halted elsif KICK = '1' then -- else if watchdog is being kicked counter <= INTERVAL; -- restart timer else -- else counter <= counter - 1; -- advance timer end if; end if; TIMEOUT <= elapsed; -- send register output to TIMEOUT end process; end behavioral; </syntaxhighlight> ====Analog watchdogs==== [[File:Analog WDT.svg|thumb|Simple analog watchdog timer]] [[File:Analog WDT timing.svg|thumb|Example timing diagram for analog WDT shown above. Four timely kick pulses keep ''V<sub>C</sub>'' below ''V<sub>TH</sub>''. When kicks cease, ''V<sub>C</sub>'' rises above ''V<sub>TH</sub>'' and causes a timeout.]] Analog WDTs have a ''kick'' input and ''timeout'' output, but lack the clock input signal found in digital electronic watchdogs. Circuitry and components vary widely among analog watchdogs, but in general, analog WDTs typically base their timing functions on [[capacitor]] charging rates. For example, in the analog watchdog circuit shown to the right, electric current ''i'' gradually charges capacitor ''C'', causing voltage ''V<sub>C</sub>'' to ramp up (rise at a constant rate). In normal operation, periodic "kick" pulses are applied to the kick input. Each kick causes capacitor ''C'' to discharge, thus restarting the voltage ramp-up. However, if the kicks cease or become spaced too far apart in time, ''V<sub>C</sub>'' will rise above threshold voltage ''V<sub>TH</sub>'' and, as a result, the [[voltage comparator]] will assert the ''timeout'' signal.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)