Due to the U.S. Thanksgiving holiday, please expect delayed responses during the week of 11/22.

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.

TMS320F280025-Q1: GPIO and ePWM configuration to avoid any unnecessary pulse output

Part Number: TMS320F280025-Q1
Other Parts Discussed in Thread: C2000WARE

Hi Experts,

I would like to avoid unwanted pulse output by ePWM just after the PWM configuration is done.

Please let me clarify with you which one is correct procedure for the setting A) or B).
A) GPIO configuration -> PWM configuration by following the procedure 1 to 4 described in Time-Base Clock Synchronization.(TRM)
B) PWM configuration by following the procedure 1 to 4 described in Time-Base Clock Synchronization -> GPIO configuration.

Our C2000ware example follows A).
According to the e2e : https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/334305
It seems that B) is recommended.
Could you please check it.

If B) is correct, is there any wait time necessary after the procedure 1 to 4 is done.
For example, it has to wait for a PWM timer period, etc.

Best regards,

  • So it is really a RECOMMENDATION.

    For example, I like to set up my GPIO first, then enable the EPWM (set TBCLKSYNC). This way the initial pulse of the EPWM is completely available on the pin.

    If you for example have deadband in complementary mode, the moment you change the GPIO mode to be driven by EPWM, even if the EPWM time is not enabled yet (TBCLKSYNC is not set), the GPIOs will go to complementary mode. 

    So it really depends on how you want to do it in your code and how your setup is. 

    Some users like to set the GPIO outputs to a predefined state, then configure the EPMW, then run the EPWM, then switch the GPIO mode. 

    It really comes down to your hardware and how you want to handle it. In MANY cases it doesn't even matter which one gets initialized first.


  • Hi Nima,

    Thank you for your kind explanation.
    The customer is using the deadband in complementary mode.
    An unexpected short pulse occurs with the case A). On the other hand, there is no pulse with the case B).

    They believe that the unexpected pulse was created by not initialized active register in ePWM when ePWM was first configured.

    Let us clarify that the value of the shadow register is transferred to the active register when TBCLKSYNC is set.
    Is our understanding correct?

    Thank you and best regards,

  • They are correct from what my assumptions are. If they enable the GPIO first, then as they are moving through their EPWM settings and enable deadband complimentary, immediately after setting the complementary mode, the A and B channels on GPIO become complimentary. They have many many options on how to resolve this. ONE option as mentioned before is enabling the GPIO configuration to be run by EPWM after the EPWM initialization is completed.


  • Hi Nima,

    The customer understood the reason and will follow the procedure accordingly.
    Thank you so much for your skillful support.

    Best regards,