I'm not aware of a PIC with DAC, but using the built in PWM generators that many PIC's have (The 18F4520 has 5 hardware PWM controllable outputs)
Pulse Wave Modulation is a signal that has both frequency and a duty cycle, for example;
50% duty cycle (freq = 2Khz);
**broken link removed**
25% duty cycle (freq = 2Khz);
**broken link removed**
A simple RC (resistor capacitor) circuit will 'average' this signal out.
Put simply - a 50% duty cycle will appear as 2.5V, a 25% duty cycle would appear as 1.25V.
With that in mind, a 100% duty cycle would appear as 5V, and 0% = 0V.
Now if you didnt already see, you have built a DAC (digital to analogue converter).
**broken link removed**
By using the op-amp, I am buffering the signal, as the opamp has a large input impedance, and a low output impedance (you could use a power opamp like the LM386 for more current).
One other thing to keep in mind - the faster the frequency of the PWM, the better the response rate of the circuit.
With Proton PIC Basic, the PWM of a PIC can be controlled via
Code:
HPWM Channel, Duty_Cycle, Frequency
so
would put a 25% (256 / 64) duty cycle on channel 1 @ 20Khz