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,
In TRM manual, it mentioned “if the application has enabled high-resolution period control (HRPCTL[HRPE]=1), the duty cycle
must not fall within the restricted range. Otherwise, there will be undefined behavior on the ePWM output.”
Does the “duty cycle” means duty value after CMPA (CMPB) before Dead Band calculation or after Dead Band calculation ?
In HR period enabled mode, if the PWM output is configured with dead band, in case, the CMPA(CMPB) is bigger than 3 cycles,
but the pulse width after dead band becomes smaller than 3 cycles. Does this case work?
I really appreciate your help.
Wenjing
The signal entering the HRPWM module! if the edge you are trying to place is within the 3 cycle at the beginning of the period or end of the period (depending on the mode). The HRPWM operates after TBCTR is in the operational range.
Thank you for your answer. This issue is much clear to me.
Here is another issue that is not clear to me.
In “TMS320F2838x Microcontrollers TRM (Rev. C)”, it seems that the following description has been newly added.
“In up-count mode, when using both high resolution duty and high resolution period control, the high resolution deadband module is NOT available.”
Regarding this, I could like to clarify the 2 questions below.
1. Is the above restriction to up-count mode only?
2. Is it possible to use both HR duty (CMPAHR, CMPBHR) and HR deadband when disabling high resolution period control (HRPE = 0)?
1. Is the above restriction to up-count mode only?
Yes only COUNT UP mode. IF you want all of the features, use COUNT UP-DOWN.
Is it possible to use both HR duty (CMPAHR, CMPBHR) and HR deadband when disabling high resolution period control (HRPE = 0)?
Yes For HR DUTY alone you do not need HRPE. For deadband HR, you should be okay as well.
Hi, Nima
Thank you for reply.
I have tried to test HR duty( adjust CMPAHR, CMPAHR ) with HRPE= 1 and 0 in up-down count mode.
My test result is as follows.
HR duty works correctly with HRPE= 1
HR duty does not work with HRPE= 0
Could you take a look at this and let me know the cause.
I really appreciate your help.
Regards,
Wenjing
Take a look at this example:
https://dev.ti.com/tirex/explore/node?node=AM0GA77BJ5qUFa.JunSyDg__gYkahfz__LATEST
Hi, Nima
Thank you for prompt reply.
At this moment I am not available to test this example,
but I have reviewed the codes, in this project, it seems that HR duty is running with HRPE= 1.
With HRPE= 1, HR duty of my code is also working fine.
Please see the code of
HRPWM_enablePeriodControl(ePWM[j]) ; line 389 of hrpwm_ex4_duty_updown_sfo.c
which executes HRPE= 1.
I would be very grateful if you could check the example with HRPE= 0 ?
regards,
Wenjing
// // Turn on high-resolution period control for DUTY to take HR on BOTH EDGEs. // HRPWM_enablePeriodControl(ePWM[j]);
When usign up down mode and HR is needed on both edges, the Period control MUST BE enabled.
Nima
Hi, Nima
Thank you for answer.
Now it is clear that the HR Period control MUST BE enabled (HRPE =1), when using up-down mode for HR duty.
Since my project needs multi-mode with HR, following questions are not clear to me.
Best regards,
Wenjing
1. I believe in UP-COUNT since you can only do 1 HR edge, you should be okay without it.
2. No HR deadband in UP-COUNT mode
3. Just CMPBHR.
Nima
Hi, Nima
Thank you for answer.
In my project, I need change PWM phase by setting both of CMPA and CMPB in up-count mode.
1. I believe in UP-COUNT since you can only do 1 HR edge, you should be okay without it.
Does it mean HR Period control MUST BE enabled when setting both of CMPA and CMPB in up-count mode?
If yes, since HR deadband does not work with HR Period control (HRPE = 1) in UP-COUNT mode,
the result is that NO HRPWM in up-count mode with using both of CMPA and CMPB, is my understanding right?
Best Regards,
Wenjing
No the HRPRD mode, when talking about BOTH EDGEs, we are talking about SETTING on CMPA before PRD and CLEARING on CMPA after PRD.
Thats the two edge mode HRPWM supports. Its not about CMPA and CMPB being used on the same signal.
Hi, Nima
Thank you for explanation of BOTH EDGES.
HR duty in up-count is much clear to me While referring to C source example.
Best Regards,
Wenjing