The LM358 is not a rail-rail type op amp.My goal is to get a smooth sustained DC signal at 1.4V if I have a 50% duty cycle.
This is my circuit so far, where R5 & R7 reduce the PWM signal so it lies between the op amp's 0.3V - 2.5V rails.
It has a maximum output of about 1.5V below the supply rail, so if you want 2.8V maximum output. the supply voltage should be 5V.
Below is the LTspice simulation a simple RCRC LP filter circuit that should do what you want:
You don't need an op amp since the Vset input has a high impedance.
From the data sheet:
"Leave floating, internal current source (typical 1.4µA) will pull up this pin to 4.5V"
This implies an input impedance of at least 3.2MΩ.
The output is 1.42Vdc for a 12V, 1kHz, 50% duty-cycle input, with a rise-time of about 22ms.
Of course the circuit will work well for any PWM frequency higher than that.
