PWM issues
Posted: Sat Sep 19, 2020 2:33 pm
Hello All
I am trying to use the PWM outputs form the dsPIC33EP32MC504 to gernerate various waves from data stored in a LUT. In general it works very well, however I seem to be getting glitches on the falling edges (aways seems to be on falling, and never rising).
As you can see in the triangle wave example, as the PWM duty is reducing, for some reason the duty glitches in the high state so stays on longer than it should (never in the low). The glitch also seems to move accross the peroid of the waves on a sort of pattern that repeats every few periods.
Things I have tried:
I have tried chaning the clock sourse from the PWM component
I have tried changing the PWM frequencies.
I have tried changing the number of values within the LUT per period of the sine wave
I have tied using both pull and and pull down reistors.
I have tried changing all the values between bytes and ints (for some reason when the addresses are ints, this resets the whole program every few seconds).
I have added two examples. One where you can see both the PWM generated and the trianlge wave (the same signal but run via a filter). The other one is a sample of two different PWM modules filtered running together and showing a similar patten.
Any ideas will be useful, I have attached my test program.
Thanks
I am trying to use the PWM outputs form the dsPIC33EP32MC504 to gernerate various waves from data stored in a LUT. In general it works very well, however I seem to be getting glitches on the falling edges (aways seems to be on falling, and never rising).
As you can see in the triangle wave example, as the PWM duty is reducing, for some reason the duty glitches in the high state so stays on longer than it should (never in the low). The glitch also seems to move accross the peroid of the waves on a sort of pattern that repeats every few periods.
Things I have tried:
I have tried chaning the clock sourse from the PWM component
I have tried changing the PWM frequencies.
I have tried changing the number of values within the LUT per period of the sine wave
I have tied using both pull and and pull down reistors.
I have tried changing all the values between bytes and ints (for some reason when the addresses are ints, this resets the whole program every few seconds).
I have added two examples. One where you can see both the PWM generated and the trianlge wave (the same signal but run via a filter). The other one is a sample of two different PWM modules filtered running together and showing a similar patten.
Any ideas will be useful, I have attached my test program.
Thanks