Sin wave output with PWM pin output amplitude question

What are you expecting to drive from the signal? The filter calcs assume there is nothing further connected!
Also you should probabaly lose the inductor and go for a simple RC filter with r appropriate to the PWM output. eg upwards of 200 ohm.

Then you may need to buffer the output to suit your load.

Finally, the frequency of the harmonic (Fh) will be N times the fundamental (F0) where N is the number of sample points. So to get good separation between F0 and Fh you should generate upwards of 100 samples per wave.

1 Like