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.

TMDSDOCK28379D: PWM duty cycle update on the run

Part Number: TMDSDOCK28379D
Other Parts Discussed in Thread: C2000WARE

Hi,

I have an issue with updating duty cycle on EPWM on the run. The update of duty cycle takes around 1us, which is not acceptable, SYSTEM clk is 200MHz, TBPRD is 1000u, PWM freq is 50Khz.

I am using this code  to initialize PWM with dead band =>

initEPWMWithoutDB(EPWM11_BASE,2);
setupEPWMActiveHighComplementary(EPWM11_BASE);

After this trying to write to CMP regiter to update the duty cycle =>

EPWM_setCounterCompareValue(base, EPWM_COUNTER_COMPARE_A, Value);
EPWM_setCounterCompareValue(base, EPWM_COUNTER_COMPARE_B, Value);

Please let me know why duty cycle update takes such a long time, is there any way to reduce it?

Regards,

Parvathi

  • Hi Parvathi,

    When are you loading your compare values? If you have shadow mode enabled then depending on how you configured it this could be happening at a zero, period, or both a zero/period event. The most ideal would depend on how you have configured your system and what other actions are happening during these events. Another option is to do immediate mode instead of shadow mode meaning all writes and reads directly access the active register for immediate compare action.  I would suggest for you to try these different options based on your requirements.

    Best Regards,

    Marlyn

  • Hi Marlyn,

    Thank you for your inputs. Finally I have resolved this. I was using C2000 examples (C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2837xd\examples) driver lib project . These gave me huge delay, might be due to wrapper functions. But when I used examples with register settings (C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2837xd\examples) only and to api , Iam getting only 50ns delay.

    Regards,

    Parvathi