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.
Hi,
Customer faced one issue about PWM when CMPA is greater than TBPRD.
1) Up down mode;
2) Period is 2222;
3) CMPA is updated by shadow register, when CTR=Zero and CTR=PRD.
CMPA is increased from 0, by 10 each period. So CMPA will be 0, then 10, 20, 30 and so on.
When CMPA increases, the PWM duty increases too. After CMPA is loaded with 2220, there's a toggle in yellow line. At that moment, PWM works fine. In the next CTR==PRD, 2220 is loaded to CMPA by shadow. In the next cycle, CMPA is loaded with 2230, there's another toggle in yellow line. In the next CTR==PRD, 2230 is loaded to CMPA. After that, PWM should output High as before, but there's one period Low. We'd like to know why. If 2222 is loaded instead of 2230, there's no this kind of issue.
In the oscilloscope, there's a delay of the 22us low in green line. As we delay the load of 2230 one period cycle.
Thanks a lot.
Br, Jordan
Hi Jordan,
What are the settings for your action qualifier? Please provide what happens on the following events (output set high, low, or nothing):
CTR = 0
CTR = CMPA
CTR = CMPB
CTR = PRD
If you can copy and paste your initialization code that will be helpful as well.
Regards,
Kris
Hi Jordan,
If the shadow->active load is taking effect on CTR=0, then the last CMPA event would have been CAD which clears the PWM. When the shadow value of CMPA > PRD is loaded in for the next cycle, CAU will never be reached to set the PWM high again. This is why you are seeing the low pulse.
Does that answer the question?
Regards,
Kris