Part Number: TMS320F28027
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE
Hi Team,
After debugging with XDS100V3, the customer finds that a PWM pin (EPWM2B / GPIO3) goes directly high when it do not run, causing hardware corruption. When the program is run, the state returns to normal. It will occur every time and is reproducible and the difference is after using the XDS100V3 burn, the wait time varies, approximately 15s to 30s.


Please see below for the code of the initialization:
void devPWM_HVCtrl_Init(CLK_Handle myClk, PWM_Handle myPwm2)
{
CLK_enablePwmClock(myClk, PWM_Number_2);
// Set timer period
PWM_setPeriod(myPwm2, HVCTRL_PWM_COUNT);
PWM_setPhase(myPwm2, 0x0000); // Phase is 0
PWM_setCount(myPwm2, 0x0000); // Clear counter
// Setup TBCLK
PWM_setCounterMode(myPwm2, PWM_CounterMode_Up);
PWM_disableCounterLoad(myPwm2); // Disable phase loading
PWM_setHighSpeedClkDiv(myPwm2, PWM_HspClkDiv_by_1); // Clock ratio to SYSCLKOUT
PWM_setClkDiv(myPwm2, PWM_ClkDiv_by_1);
PWM_setShadowMode_CmpA(myPwm2, PWM_ShadowMode_Shadow); // Load registers every ZERO
PWM_setShadowMode_CmpB(myPwm2, PWM_ShadowMode_Shadow);
PWM_setLoadMode_CmpA(myPwm2, PWM_LoadMode_Zero);
PWM_setLoadMode_CmpB(myPwm2, PWM_LoadMode_Zero);
// Setup compare
PWM_setCmpA(myPwm2, 0);
PWM_setCmpB(myPwm2, HVCTRL_PWM_COUNT);
// Set actions
PWM_setActionQual_CntUp_CmpA_PwmA(myPwm2, PWM_ActionQual_Set);
PWM_setActionQual_CntUp_CmpB_PwmA(myPwm2, PWM_ActionQual_Clear);
PWM_setActionQual_CntUp_CmpA_PwmB(myPwm2, PWM_ActionQual_Clear);
PWM_setActionQual_CntUp_CmpB_PwmB(myPwm2, PWM_ActionQual_Set);
// Active Low PWMs - Setup Deadband
devPWM_DeadbandEnable(myPwm2, true);
}
void devPWM_DeadbandEnable(PWM_Handle myPwm1, bool bEn)
{
if(bEn)
{
EALLOW;
EPwm2Regs.TZFLG.bit.CBC = 0;
EPwm2Regs.TZFLG.bit.OST = 0;
EPwm2Regs.TZCTL.bit.DCBEVT1 = 2;
EPwm2Regs.TZCTL.bit.DCBEVT2 = 2;
EPwm2Regs.TZCTL.bit.TZB = 2;
EPwm2Regs.TZFRC.bit.DCBEVT1 = 1;
EPwm2Regs.TZFRC.bit.DCBEVT2 = 1;
EPwm2Regs.TZFRC.bit.CBC = 1;
EDIS;
// Active Low PWMs - Setup Deadband
PWM_setDeadBandOutputMode(myPwm1, PWM_DeadBandOutputMode_EPWMxA_Rising_EPWMxB_Falling);
PWM_setDeadBandPolarity(myPwm1, PWM_DeadBandPolarity_EPWMxB_Inverted);
PWM_setDeadBandInputMode(myPwm1, PWM_DeadBandInputMode_EPWMxA_Rising_and_Falling);
PWM_setDeadBandRisingEdgeDelay(myPwm1, EPWM1_MIN_DB);
PWM_setDeadBandFallingEdgeDelay(myPwm1, EPWM1_MIN_DB);
}
else
{
PWM_disableDeadBand(myPwm1);
}
//================================================================================//
The customer also attempted to select the following settings in CCS but still did not improve: (RealTime options)

Could you please help check this case? Thanks.
Best Regards,
Cherry