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 experts,
When HRPWM is enable, CMPAHR has a range (1-255) like below in TRM
(https://dev.ti.com/tirex/explore/node?node=AM0GA77BJ5qUFa.JunSyDg__gYkahfz__LATEST)
For example, PWM period(N PWM clock cycle)
ePWM clock 200MHz(=5nsec), in up and down count mode.
Carrier frequency 100kHz, ->10usec -> PRD=(10000/2)/5=1000
TBPRDHR=0
If duty = 50%, what count values should we set on CMPA and CMPAHR ?
(In this question, I ignore dead band time because I would like to focus on this topic)
Although if "CMPAHR = 0" can work correctly, we will do so and CMPA=500.
In my opinion, there are two options.
a) CMPA=499, CMPAHR=255
b) CMPA=500, CMPAHR=1
Could you please let us know how we should set values on CMPAHR to control duty more exactly ?
Best regards,
Hidehiko
a) CMPA=499, CMPAHR=255
b) CMPA=500, CMPAHR=1
The line items above is also my understanding as well. CMPA=500, CMPAHE=0 causes a big jump when HR is enabled.
always in your code, similar to what I have in the example, check if the CMPAHR=0 then if it is, set it to 1.
Nima
Hi Nima,
Thank you for your answer.
We'll treat the big jump cases carefully.
Best regards,
Hidehiko