PWM_setCounterMode(pwmHandle, PWM_CounterMode_Up); // Count up PWM_setPeriod(pwmHandle, EPWM4_
tiMER_TBPRD); // Set timer period PWM_disableCounterLoad(pwmHandle); // Disable phase loading PWM_setPhase(pwmHandle, 0x0000); // Phase is 0 PWM_setCount(pwmHandle, 0x0000); // Clear counter PWM_setHighSpeedClkDiv(pwmHandle, PWM_HspClkDiv_by_1); // Clock ratio to SYSCLKOUT PWM_setClkDiv(pwmHandle, PWM_ClkDiv_by_1); // Setup shadow register load on ZERO PWM_setShadowMode_CmpB(pwmHandle, PWM_ShadowMode_Shadow); PWM_setLoadMode_CmpB(pwmHandle, PWM_LoadMode_Zero); // Set Compare values PWM_setCmpB(pwmHandle, EPWM4_CMPB); // Set Compare B value // Set actions PWM_setActionQual_Zero_PwmB(pwmHandle, PWM_ActionQual_Set); // Set PWM4B on Zero PWM_setActionQual_CntUp_CmpB_PwmB(pwmHandle, PWM_ActionQual_Clear); // Clear PWM4B on event B, up count PWM_enableSocAPulse(pwmHandle); // Enable SOC on A group PWM_setSocAPulseSrc(pwmHandle, PWM_SocPulseSrc_CounterEqualCmpBIncr); // Select SOC from from CPMB on upcount PWM_setSocAPeriod(pwmHandle,PWM_SocPeriod_FirstEvent); // Generate pulse on 1st eventADC_setSocTrigSrc(adcHandle,ADC_SocNumber_0,ADC_SocTrigSrc_EPWM4_ADCSOCB);
1、采用PWM触发ADC 采样,但是并没有成功触发,配置如上代码,哪里出了问题?
2、28027手册中并没有高速时钟的设置介绍,是否28027不使用外部高速时钟?而库里面配置PWM时基时钟时却用到了高速时钟?
0