Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Watchdog timer is used for pervent the mcu from fall in infinite loop.
When you setup the watchdog, it will reset your mcu in predefined time.
All you have is reset watchdog timer in your code every group of instructions
even better is external watchdog ... circuit with input from your mcu and reset output to your mcu .. your mcu shuld send pulses in predefined time ... if your mcu stops responding to program iow stop send pulses circuit will reset your mcu by hardware ;0))
Microcontrollers are often used in harsh environments where power supply transients, electromagnetic interference (EMI), and electrostatic discharge (ESD) are abundant. Program corruption caused by bus corruption and electromagnetic discharges can cause a microprocessor to execute erroneous instructions. In these environments, a watchdog timer is a useful peripheral that can help catch and reset a microcontroller that has gone "out of control."
You should clear the watchdog before overflow of its timer occurs (for overflow period value check the mcu datasheet). For instance, PICs watchdog have an internal RC oscillator that is independent of the main clock source of the uC. Its timeout value can vary between 7 and 33 ms (from PIC 18F8720 datasheet). As this period is far larger than your instruction cycle period (assuming that you aren't using a very slow clock source) it gives you plenty of room for scattering watchdog reset intructions in your code.
Watchdog timer is a very usefull feature, specially when you are developing remote applications where you can't easily push the RESET button when the system locks... Just think about satellites
Hi,
in pic16 WDT is 8-bit counter where input is system MCU clock( you can divide MCU clock ), when overflow occur the RESET will be generate, you must clear WDT before overflow.However if you don't need WDT you can disable.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.