Analogue signal generation: Which is better Standalone or PWM DAC?
Given the MCU_PWM_DAC has electro-static-discharge protection diodes on the (inputs and) outputs of the MCU, your signal will always have MCU_CLOCK and MCU_program_related spikes and trash that are non-random.

Use this filter on the "DAC"







simulate this circuit &ndash; Schematic created using CircuitLab