piclist 1998\11\23\165700a >
Thread: WDT and PWM question??
picon face BY : Peter L. Peres email (remove spam text)


WatchDog Timer

used to 'catch' a processor that fails to execute its destined program due
to a software or hardware glitch or bug. Causes a reset of the processor
after a set time interval if a specific instruction (CLRWDT) is not
executed before that time elapses. If the CLRWDT instruction executes, the
timer is reset and counts down from the preset value again. The CLRWDT
instruction has no other effects so it can be used anywhere in the
program. At reset, a PIC program can determine whether it was reset
manually by power-up reset on MCLR or by a watchdog interrupt by examining
a flag in the processor status register.

 The idea is, that a program may drive critical hardware and / or have
critical functionality and that it is essential to have a hardware method
to detect when the program does not execute the relevant instructions in
time. The programmer (human, code generator) enables the Watchdog timer
and inserts CLRWDT instructions in the program parts that must be executed
to guarantee the critical functionality, and only there. If these fail to
execute for some reason, a reset occurs after the watchdog timeout, and
the programmer's initialization routines, which should cover the critical
device, reset or initialize it, and prevent a disaster. Disasters range
from a vessel filling with water until it overflows because a glitch or
error stuck a valve open to far worse than that. There is no gurantee that
using the WDT makes your device 'Safer' in any way, but it's a good try.

 The WDT also has other uses, such as inaccurate timekeeping, low power
operation (the watchdog will wake up a sleeping PIC - a sleeping PIC
requires much less power than a working one), and timesharing PICs with no
interrupts (i.e. PICs that HAVE no interrupts at all - such as a 16C54 ;),
or PICs whose timer interrupt is already used for something else ;)  ;).
The latter application is best left to experts ;)

;) ;) ;)


Pulse Width Modulation - a hardware module present in some PICs capable to
generate a square wave signal with a variable duty cycle and frequency.
The frequency and the duty cycle of the square wave can be set using PIC
registers and processor instructions. The square wave is available at an
output pin, and can be used to drive a switching mode power supply,
switching power driver, servo, PWM or PPM signalling, or D/A function by
passing it through a low pass filter. The operation of the PWM module does
not consume processor cycles, except during the setup of the mode (loading
registers etc).

hope this helps,



In reply to: <"ISOPRO-1.61 .063::DH-NO::58A1::3659DF14*/G=Steve/S=Kosmerchock/OU=Phoenix/O=Celwave/PRMD=A CAB/ADMD=Telemail/C=US/"@MHS>
See also: www.piclist.com/techref/io/pwm/index.htm?key=pwm
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) WDT and PWM question??

month overview.

new search...