This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0L1306: sporadic Peaks on smoothed PWM Signal

Part Number: MSPM0L1306

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?

  • Hey Daniel,

    What I think is probably happening, is you are loading the CCx register while the timer is running with a period value smaller than the current timer count, and it's causing the CCx register to miss the compare so you get 1 cycle of 100% duty cycle randomly mixed in before it loops.   The likely hood of this happening usually goes up as the duty cycle count is getting lower.  

    On TIMG0-TIM3 do not have shadow load registers on the CCx registers, which are what allow the load to take place at exactly at the zero event.  Now, TIMG4 in the MSPM0L1306 does have the shawdow registers and if you use those, then I think you will avoid this issue. 

     

    Hope this helps.  

    Thanks,

    JD