
Accurate, fast settling analog voltages from digital PWM signals, app note from Linear Technology (PDF!):
Pulse width modulation (PWM) is a common technique for generating analog voltages from a digital device such as a microcontroller or FPGA. Most microcontrollers have dedicated PWM generation peripherals built in, and it only takes a few lines of RTL code to generate a PWM signal from an FPGA. This is a simple, practical technique if the analog signal’s performance requirements are not too stringent, as only one output pin is required and the code overhead is very low when compared to a digital- to-analog converter (DAC) with an SPI or I 2C interface.
