craig said:
Hi guys,
I have a 12bit PWM output (0 to 5V) on my PIC.
I need to generate a 0-12V analog output.
preferably 50% duty cycle = 6V output.
I do have a 12V supply in my circuit already.
Any ideas on a simple way to convert the PWM to an analog signal.
CMOS 4011 used as a buffer, on 12V supply.
+12V
|
|
|
10K
|
| two 4011 gates
.-----------=[]o---=[]o----------10K-----.-------------- analog voltage
| |
| 1uF
| |
| GND
4K7
|
|
|
PIC PWM 0-5V
I was going to suggest some of the chips designed for level
shifting (with separate supply pins for the input stage and the
output stage) or else a three BJT circuit (low impedance HI and
LO, of course.)
The 4011 is indeed simple.
But a high input must be at least 70% of the rail to meet the
worst case specs. That's 12*70% or 8.4V. And a low input must
be no more than 30% of the rail to meet the worst case specs.
That's 12*30% or 3.6V.
With the resistor values above and assuming that the PIC outputs
are dead-on 0V and 5V, these are:
HI (5V*10k+12V*4k7)/(10k+4.7k) = 7.24V
LO (0V*10k+12V*4k7)/(10k+4.7k) = 3.84V
Which misses the worst case thresholds -- both of them. No?
Jon