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.
Tool/software: Code Composer Studio
Hi,
According to the link below, it seems that the PWM register can be updated twice within one PWM cycle. ( "Many PWM modules (such as the ones on our Piccolo family of processors) have the ability to be updated TWICE during each PWM cycle.")
https://e2e.ti.com/blogs_/b/industrial_strength/archive/2011/12/23/the-ten-commandments-of-digital-control-part-5
I realize that the compare value can be configured as loading the compare shadow register on BOTH CTR=zero AND CTR=period.
Here goes my problem. I update the compare value in the ePWM interrupt which is triggered when CTR=zero. This means that even the CPMA is updated twice during one PWM cycle, it makes no sense because the compare value does not change.
Can anyone tell me how to do the real twice update?
Thanks in advance.
Best regards,
Keting
Try using up-down-count mode and make sure that you configure the CMPx registers to be shadowed. You will then need to setup the shadow loads to occur on "both CTR = PRD and CTR = Zero".
With this configuration any value you write during the first half of the PWM period will be loaded at CTR = PRD. After CTR = PRD any updated that occurs in the second half of the PWM period will be loaded at CTR = Zero.
Hope it helps!
Regards,
Cody