我按照ti官网提供的starware中的api函数配置EHRPWM,一直没有波形出现,请大神帮我看一下有什么不对吗?
main()
{
int32_t Prcmen_val;
uint32_t i=0;
uint32_t instNum=0U;
Prcmen_val=PRCMModuleEnable(CHIPDB_MOD_ID_PWMSS,instNum,FALSE);
if(S_PASS==Prcmen_val)
{
/********************************pin mux**********************************************************/
HW_WR_REG32((SOC_CONTROL_MODULE_REG + CTRL_CONF_SPI0_SCLK), 3U);//pwm0A
HW_WR_REG32((SOC_CONTROL_MODULE_REG + CTRL_CONF_SPI0_D0), 3U);//pwm0B
/*************************************************************************************************/
EPWMClockEnable(SOC_PWMSS0_REG);
/*********************Enable Time base clock for PWMSS module*************************************/
SOCCtrlPwmssTimebaseClkEnable(0U);
/*******************************EPWM channel configuration****************************************/
//timebase
/*******************************Configure the time base clock*************************************/
EPWMTbTimebaseClkCfg(SOC_PWMSS0_REG,10000000U,100000000U);
/*******************************Configure the output PWM frequency*************************************/
EPWMTbPwmFreqCfg(SOC_PWMSS0_REG,10000000U,20000U,EPWM_TB_COUNTER_DIR_UP,EPWM_SHADOW_REG_CTRL_ENABLE);
/*******************************configure the synchronization******************************************/
EPWMTbSyncEnable(SOC_PWMSS0_REG,3U,EPWM_TB_CNT_DIR_AFT_SYNC_UP);
/*******************************Set the sync out mode**************************************************/
EPWMTbSetSyncOutMode(SOC_PWMSS0_REG,EPWM_TB_SYNC_OUT_EVT_DISABLE);
/*******************************Set the emulation mode*************************************************/
EPWMTbSetEmulationMode(SOC_PWMSS0_REG,EPWM_TB_EMU_MODE_FREE_RUN);
//Counter comparator
EPWMCounterComparatorCfg(SOC_PWMSS0_REG,EPWM_CC_CMP_A,500U,EPWM_SHADOW_REG_CTRL_ENABLE,EPWM_CC_CMP_LOAD_MODE_CNT_EQ_PRD,TRUE);
//DeadBand
EPWMDeadbandBypass(SOC_PWMSS0_REG);
//Chopper
EPWMChopperEnable(SOC_PWMSS0_REG,FALSE);
//TripZone
EPWMTzTriggerTripAction(SOC_PWMSS0_REG,EPWM_TZ_TRIP_ACTION_HIGH,EPWM_OUTPUT_CH_A);
EPWMTzTripEventEnable(SOC_PWMSS0_REG,EPWM_TZ_EVENT_CYCLE_BY_CYCLE,1);
//Event Trigger
EPWMEtIntrDisable(SOC_PWMSS0_REG);
//HighResolution
EPWMHighResolutionCfg(SOC_PWMSS0_REG,EPWM_HR_DELAY_BUS_SEL_CMPAHR,EPWM_HR_DELAY_EDGE_CTRL_NO_DELAY);
EPWMHrLoadCmpAHrValue(SOC_PWMSS0_REG,10U,EPWM_HR_REG_ACT_LOAD_CNT_ZRO_PULSE);
while(1)
{
/* Infinite loop */
}
}
return(0);
}