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.

TMS320F28379D: Example to understand duty cycle, phase and frequency of EPWM

Part Number: TMS320F28379D


Hello,

I have started using Launchpad F28379D. I am trying to implement EPWM using this. I found some example and I am following one of them called 'epwm_updown_aq'. But I am having few problems to understand how to change the phase, and the duty cycle. My task is related to change the duty cycle, phase, and frequency. Is there any more effective example from where I can get a clear idea about these things? 

  • Well your first source should be the TRM. Read the F2837x EPWM TRM Chapter. 

    After you read you can see that

    1. To change Period/Frequency: You use the TBPRD register.

    2. To change the Duty: You use the CMPA/CMPB registers.

    3. To change the phase shift: You use the TBPHS register.

    Nima Eskandari

  • Hello Eskandari,

    Thank you for your reply. I am able to change the Duty cycle and phase by changing those register. But I am facing issue ti understand the frequency.

    In the epwm_updown_aq example, they defined TBPRD as 2000 but when they assigned this value to EPwm1Regs.TBPRD register, they stated that this timer period value defines 801 TBCLK.

    I am a bit confused how this TBPRD = 2000 is equal to 801 TBCLK.

    Thank you.

    Shamsul

  • That value means 2001 tbclk. I’m up down it means you go up to 2000 from zero then back down to zero. If you’re reading that in a comment then that is wrong.