Possibility of using the PWM output as a proportional DC output??
Peter L. Peres email (remove spam text)
On Thu, 1 Oct 1998, Craig Lee wrote:
> I am attempting to use the PWM output on a '73A through a
> capacitor to ground to get a proportional DC voltage out.
> The PWM frequency is 3090 Hz and the duty cycle is varied.
> However, I get too much ripple on the DC output.
> Any brilliant ideas? Is my frequency too low? Too high? How
> do I select the proper capacitor? Do I need a diode?
You need a low pass filter. The easiest would be a resistor between the
PIC pin and the capacitor, for now. Choose one such that T = R * C >= 10 /
f0 for starters. This has some tradeoffs (such as settling speed and
output impedance) but it works. Later, you may want to use a coil instead
of the resistor and add a diode or two. This will improve matters
considerably but needs some calculations. If you want really smooth dc
output, use an op-amp low pass filter (active filter) chosen to attenuate
the lowest component in the PWM to your required ripple specs.
hope this helps,
In reply to: <email@example.com>
See also: www.piclist.com/techref/io/pwm/index.htm?key=pwm
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the