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.

F28M35H52C: EPWMxB is not working same as EPWMxA

Part Number: F28M35H52C

Hi,

Below is my configuration for EPWM9. I have generated SPWM for 3 phase using PWM2 to 7.

I want t generate 50Hz squere wave in sync with SPWM. I use PWM9A to generate 50HZ for Uphase, 9B for W phase.

My configuration is as below.

EALLOW;
// TZ1 Interrupt Enable
EPwm9Regs.TZSEL.bit.OSHT1 = 1; // TZ 1 Source for FORCE PWM HIGH
EPwm9Regs.TZCTL.bit.TZA = TZ_FORCE_HI;
EPwm9Regs.TZCTL.bit.TZB = TZ_FORCE_HI;

EPwm9Regs.TBPRD = 18750; //PWM PERIOD
EPwm9Regs.TBPHS.half.TBPHS = 0; // Phase is 0
EPwm9Regs.TBCTR = 0; // Clear counter

// Setup TBCLK
EPwm9Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;
EPwm9Regs.TBCTL.bit.PHSEN = TB_ENABLE;
EPwm9Regs.TBCTL.bit.PHSDIR = TB_UP;
EPwm9Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1;
EPwm9Regs.TBCTL.bit.CLKDIV = TB_DIV1;

EPwm9Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm9Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm9Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
EPwm9Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;

// Setup compare
EPwm9Regs.CMPA.half.CMPA = 0; // InitialCompare
EPwm9Regs.CMPB = 0; // InitialCompare

EPwm9Regs.AQCTLA.bit.CAU = AQ_SET;
EPwm9Regs.AQCTLA.bit.CAD = AQ_SET;
EPwm9Regs.AQCTLB.bit.CBU = AQ_SET;
EPwm9Regs.AQCTLB.bit.CBD = AQ_SET;

EPwm9Regs.AQSFRC.bit.ACTSFA = 0x02;
EPwm9Regs.AQSFRC.bit.ACTSFB = 0x02;
EPwm9Regs.AQSFRC.bit.RLDCSF = 0x03;

EPwm9Regs.DBCTL.bit.OUT_MODE = DB_DISABLE; // Dead Band Module is disabled
EDIS;

For generation of Sine wave, I just make PWM pin high whenever there is positive sine ware and Set PWM pin LOW when sine is negative..

Code for 50Hz Squerwageneration;
Actual Requirement is some thing different but this is part of the code where i have to generate 50Hz Squerwave in sync with SPWM.

VUREF_RAM_PWM12 =>> Sine PWM

if(VUREF_RAM_PWM12 >= 0)
{
EPwm9Regs.AQCTLA.bit.CAU = AQ_SET;
EPwm9Regs.AQCTLB.bit.CBU = AQ_SET;
}
else
{
EPwm9Regs.AQCTLA.bit.CAU = AQ_CLEAR;
EPwm9Regs.AQCTLB.bit.CBU = AQ_CLEAR;
}

At PIN 9A : There is 50Hz square wave

At PIN 9B: Only Constant High +3.3V is observed.

I made same configuration to verify in PWM7 module. There also, PWM7A is giving 50Hz sine wave but PWM7B is giving constant high.

can any one help on this?

Re,

Umang

  • Did you enable the EPWM7b or 9B mux option at the GPIO buffer?

    Do you have any other configuration like the Trip zone module? Since I see some configuration there i would say that the trip zone is the last module to affect the PWM output, so if it tries to drive the PWM output high it doesn't matter what happens inside of the Action Qualifier.

    Are you using the Dead-band submodule at all?

    Regards,
    Cody