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.

EPWM module can't clear PWM output pin immediately using AQCSFRC

Part Number: C6745

EPWM1 and EPWM2 generate two PWM to drive one full bridge,and the full bridge are connected to one transformer.

The counter waves of EPWM1 and EPWM2  are showed in below picture(Blue line for  EPWM1,Green line for EPWM2):

TBPRD of EPWM1 is one less than EPWM2,so period of two PWMs are identical.CMPA of EPWM2 is loaded from shadow when counter equals to TBPRD,while CMPA of EPWM1 is loaded when counter equal to ZERO.

Here is the problem:

I stop PWM generating by calling function below:

void pwm_igbt_off(void)
{
    PWM1_AQCSFRC = 0x05;
    PWM1_AQSFRC  = 0xED;
    
    PWM2_AQCSFRC = 0x05;
    PWM2_AQSFRC  = 0xED;
    
    PWM1_CMPA    = 0;
    PWM2_CMPA    = 0;
}

void pwm_igbt_on(void)
{
    PWM1_AQCSFRC = 0x00;
    PWM1_AQSFRC  = 0x00;
    
    PWM2_AQCSFRC = 0x00;
    PWM2_AQSFRC  = 0x00;
}

but the PWMs are not cleared immediately,below are screenshot of oscilloscope:

                     picture 1                                                                                              picture 2

The green line changing  from high to low in picture 1 and picture 2 is the time when the program  calls function pwm_igbt_off().In picture 1,two tiny pulses are generated after clearing pwm output.In picture 2,PWM1 is cleared but PWM2 still output one pulse that not been influenced.

Any suggestion is appreciated.

  • Hello Xing,

    TI has stopped supporting bare-metal SW development for C674x DSP. Please refer to this announcement and find consolidated resources there.

    Meanwhile, let me loop in our HW team to see if they have any comments.

    Regards,

    Jianzhong

  • Hello Xing,

    Not much. I assume this is a custom board and see this issue occurring on multiple boards.

    Regards,

    Sreenivasa

  • Yes,it's a custom board.Do you think this is hardware problem ?

    By the way,I change the turning on and off function as:

    void pwm_igbt_off(void)
    {
        PWM1_AQSFRC  = 0xED;
        PWM1_AQCSFRC = 0x05;
        
        PWM2_AQSFRC  = 0xED;
        PWM2_AQCSFRC = 0x05;
        
        PWM1_CMPA    = 0;
        PWM2_CMPA    = 0;
    }
    
    void pwm_igbt_on(void)
    {
        PWM1_AQSFRC  = 0xC0;
        PWM1_AQCSFRC = 0x00;
        
        PWM2_AQSFRC  = 0xC0;
        PWM2_AQCSFRC = 0x00;
    }

    Then all problem disapear.I know the difference between modified and the orignal code.The modified code will immediately clear pwm output,and the orignal code clear the pwm output after the next time when couter equal to zero,because AQCSFRC takes effect when couter equal to zero .

    but I also use AQSFRC to clear pwm output at now and then AQCSFRC takes effect in the next period,there should be no problem,but the problem did exist.

    Best regards!

  • Hello Xing,

    Thank you for the inputs.

    Since you know the board, setup and the overall implementation you are in the best position to review or analyze the issue.

    is this the first proto you built or you have any board working with similar configuration.

    If yes it would help to compare.

    Are you seeing the issue on multiple boards or a specific board. If you tested on one board, i would suggest you test on another one or 2 boards before continuing the debug.

    Regards,

    Sreenivasa