Using PWM to create DAC
You can do it the following way: you have PWM output that goes into a low-pass filter, which goes into buffer. The higher the frequency of pwm, the better the same RC-filter will smoothen out the line.
You can also increase R or C, but doing so will slow down voltage change response time. Find the sweet spot where you can change DAC output quickly enough while filtering good enough. And your op-amp better be rail-to-rail. Make sure to check out op amp's offset voltage to see the minimum output voltage it can give, it can be uV or even some mV even for rail-to-rail.
As a downside - that need to filter out square wave into constant voltage. Check RC-filter for 1MHz, see the rejection ratio you want, probably around 40db, but if 60db is not a problem in terms of parts, it's up to you, of course.
Anyone add/modify?