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.

How to configure PWM pins status when its initialization?

Other Parts Discussed in Thread: TMS320F28020

I'm working on a BLDC controller using tms320f28020, the MOSFET gate driver is LOW active. So I need to confirm that every PWM output pins is high  when doing GPIO initialization. While I tested it and found out every PWM pins are LOW when its initialization and that cause phase bridge shot through. Can you help me with this problem without using any external hardware?

Thanks.

  • Hi,

    I guess you're talking about when you start the debug session, the peripherals get initialized and hence you're observing this issue, right?

    Regards,
    Gautam
  • Hi.

    This issue happens at InitEPwm1Gpio(); function not during debug session.

    void InitEPwm1Gpio(void)
    {
    EALLOW;

    /* Disable internal pull-up for the selected output pins
    for reduced power consumption */
    // Pull-ups can be enabled or disabled by the user.
    // Comment out other unwanted lines.

    GpioCtrlRegs.GPAPUD.bit.GPIO0 = 1; // Disable pull-up on GPIO0 (EPWM1A)
    GpioCtrlRegs.GPAPUD.bit.GPIO1 = 1; // Disable pull-up on GPIO1 (EPWM1B)

    /* Configure EPwm-1 pins using GPIO regs*/
    // This specifies which of the possible GPIO pins will be EPWM1 functional pins.
    // Comment out other unwanted lines.

    GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1; // Configure GPIO0 as EPWM1A
    GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 1; // Configure GPIO1 as EPWM1B

    EDIS;
    }

    Thansks.