Part Number: TMS320F28075
Hello,
I am currently developing a product using the TMS320F28075 and have a question regarding HRPWM configuration in Up-Down Count mode.
I am generating a symmetrical PWM signal based on TBPRD using only CMPA in Up-Down Count mode. My goal is to apply HRPWM (High-Resolution PWM) to both sides of the TBPRD reference to achieve finer control over the minimum duty cycle.
I have attached my PWM configuration code for your reference.
EPwm1Regs.TBPRD = (PWMCLK / EPWM1_TMN_SM_0_Freq)>>1; // Set timer period 705 TBCLKs
EPwm1Regs.TBPHS.bit.TBPHS = 0x0000; // Phase is 0
EPwm1Regs.TBCTR = 0x0000; // Clear counter
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Count up and down
EPwm1Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Enable phase loading for sync signal receive
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT
EPwm1Regs.TBCTL.bit.CLKDIV = TB_DIV1;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN;
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // Load on Zero
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET; // Set PWM1A on event A, up count
EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR; // Clear PWM1A on event A, down count
EPwm1Regs.CMPA.bit.CMPA = ((PWMCLK / EPWM1_TMN_SM_0_Freq)>>1)*0.95; //initiate
EALLOW;
EPwm1Regs.HRCNFG.all = 0x0; // Clear all bits first
EPwm1Regs.HRCNFG.bit.EDGMODE = HR_REP; // MEP control on Rising edge
EPwm1Regs.HRCNFG.bit.CTLMODE = HR_CMP;
EPwm1Regs.HRCNFG.bit.HRLOAD = HR_CTR_ZERO_PRD;
EPwm1Regs.HRCNFG.bit.AUTOCONV = 1;
EPwm1Regs.HRPCTL.bit.HRPE = 0;
EDIS;
I have attempted to apply HRPWM, but I am encountering issues where it does not seem to apply symmetrically across TBPRD. As shown in the attached waveform, the HRPWM effect is only visible on the right side.
-
Red (ePWM7A): This is the reference signal with the same
CMPAvalue (without HRPWM). -
Yellow (ePWM1A): This is the signal with HRPWM applied.
- EPwm1Regs.HRCNFG.bit.EDGMODE = HR_REP;

2. EPwm1Regs.HRCNFG.bit.EDGMODE = HR_FEP

Is it possible to configure the HRPWM to also be applied to the left side (as seen in waveform #1)? If so, could you please advise on the necessary settings or adjustments?
Thank you for your assistance.