'RE(2): WDT and PWM question??'
Peter L. Peres
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
hope this helps,
More... (looser matching)
- Last day of these posts
- In 1998
, 1999 only
- New search...