I generate a PWM signal using the timerG0. The signal is decoupled with a "Single Schmitt-Trigger Inverter Gate" and smoothed with a 2nd order RC low pass. When outputting a triangular signal, it sporadically has peaks on the signal. If a constant voltage is output, this phenomenon does not occur. I change the pulse width by adjusting the capture compare value using the "DL_TimerG_setCaptureCompareValue" function.
Purple: Output Signal viewed as an DC-voltage
Yellow: Output Signal viewed as an AC-voltage
I suspect that a PWM value is set incorrectly or not at all. Do you have a theory for this behavior and how to fix it?