Tool/software: Code Composer Studio
Dear team
My customer is using the EPWM1A and EPWM1B of TMS320F28377S.
EPWM1A (blue) sends out high-frequency signals, and EPWM1B (pink)sends outIndustrial frequency signals.
The period value is reduced by half when the high-frequency signal is inverted.
EALLOW; // EPWM Module 1 config EPwm1Regs.TBPRD = INV_PWM_TIMER_TBPRD; // Period TBCLK counts EPwm1Regs.CMPA.bit.CMPA = 0; //PWM_Control_Period_Count*0.25; EPwm1Regs.CMPB.bit.CMPB = 0; EPwm1Regs.TBPHS.bit.TBPHS = 0; // Set Phase register to zero EPwm1Regs.TBCTR = 0; EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; EPwm1Regs.TBCTL.bit.PHSDIR = TB_UP; // 0x1 EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW; EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; //TBCLK=SYSCLKOUT EPwm1Regs.TBCTL.bit.CLKDIV = TB_DIV1; EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // CC_CTR_ZERO_PRD EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; EPwm1Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM1A EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR; EPwm1Regs.AQCTLB.bit.CBU = AQ_CLEAR; // set actions for EPWM1A EPwm1Regs.AQCTLB.bit.CBD = AQ_SET; EPwm1Regs.AQSFRC.bit.RLDCSF = 0; EPwm1Regs.AQCSFRC.bit.CSFA = 0; // Software forcing disabled, i.e., has no effect EPwm1Regs.AQCSFRC.bit.CSFB = 0; // EPwm1Regs.DBCTL.bit.IN_MODE = DBA_ALL; // EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC;//DB_ACTV_LOC; EPwm1Regs.DBCTL.bit.OUT_MODE = DB_DISABLE; EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_LOC; EPwm1Regs.DBRED.bit.DBRED = 0; EPwm1Regs.DBFED.bit.DBFED = 0; EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; //Force EPWMxA to a low state EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; //Force EPWMxB to a low state EPwm1Regs.TZFRC.bit.OST = 1; EPwm1Regs.TZEINT.bit.OST = 0; //Disable one-shot interrupt generation EDIS;