Providing a linear adjustable DC voltage from PWM ( 1.5V to 3.3V)
There are plenty of ways to do what you want. There are even ICs that will do it for you (programmable voltage regulators).

But if you want to follow your path, first you need a PWM with more than 8 bits resolution (10 mV is the step, 3.3 V is the max voltage you want to reach - this is 330 steps or 9 bits), make sure that your PWM has the correct resolution.

Then you need to filter the PWM output. The "simplest" solution is indeed RC. This is not the most efficient but its ok if you can accept some ripple. Take a cuff frequency that is at least 10 times smaller than the PWM frequency for reasonable ripple attenuation (2 kHz in your case). For a first order RC filter, you select R the following way:

R = 1/(2 x pi x C x f)

Then you need to buffer to output of the filter. This can be done with an operational amplifier used as a follower. Make sure that the supply voltage of the operational amplifier is sufficient to avoid saturation and that the amplifier can supply sufficient current for your application.

You can have something like that:







simulate this circuit &ndash; Schematic created using CircuitLab

Select R1/R2 to set the gain (or attenuation), select R4/(R3+R4) to set the offset, select C*R2 to set the filter frequency. Output will be opposite to your PWM setting (0=max, 255=min).