Here is Microchip's app note on "Using PWM to Generate an Analog Output":
App Note TB3250:
http://ww1.microchip.com/downloads/en/Appnotes/90003250A.pdf
Unfortunately, it's not much help to the original poster. It relies on the MCU having a tightly regulated power supply and the OP requires 10V out. One of their examples shows a 40M resistor and 1pF capacitor, which are silly values, in most applications!
For completeness, here's the Sallen-Key filter I hinted on earlier. It was designed with the help of the tool linked below. It accepts a 2.5V waveform from the TL431 + analogue switch, shown above.
G = 4
F
C = 100Hz
ζ = 1.414
http://sim.okawa-denshi.jp/en/OPstool.phpThe value given for R1 is 24k, but R5 and C3 have been added as a pre-filter, to get rid of very high frequencies, as Sallen-Key filters fail at high frequencies, as the op-amp runs out of gain. C4 is also added to reduce the gain at high frequencies.
It might make more sense to use a gain of one and a separate gain stage, as the LM358 is a dual op-amp. I'd probably put the gain stage first, which will also perform some pre-filtering, due to the op-amp's roll-off. I just thought it would be fun to try a Sallen-Key filter with gain.
EDIT:
Whoops, the pre-filter in the above design has a lower cut-off than the active filter. Not that it matters in this application.
And here's the design with separate amplifier and filter stages. It looks more complicated, but it's not.
I used the same tool and numbers to design it, as above.
The calculator gave:
R1 = 22kΩ
R2 = 7.5kΩ
C1 = 0.1uF
C2 = 0.15uF
To reduce the number of resistor values in the circuit, thus optimising the parts list, I divided the capacitor values by 1.5 and multiplied the resistor values by 1.5.
R1 = 22kΩ ✕ 1.5 = 33k
R2 = 7.5kΩ ✕ 1.5 = 11k25, the nearest E24 value is 11k
C1 = 0.1uF / 1.5 = 66⅔nF, the nearest E6 value is 68nF
C2 = 0.15uF / 1.5 = 100nF