PWM to analog
3 parts
How a microcontroller fakes a DAC. A 10 kHz square wave with adjustable duty feeds an RC whose time constant is ten switching periods, so the capacitor holds the average and ignores the switching. The output level is just duty × supply.
- PWM1 10kHz·50%
- R1 1kΩ
- C1 1µF