为什么我用下面的程序实验啊得不到占空比为20%的方波,是不是还有那个库函数没用到?
int main(void)
{
S_DRVPWM_TIME_DATA_T sPt;
sPt.u8Mode = DRVPWM_AUTO_RELOAD_MODE;
sPt.u8HighPulseRatio = 50;
sPt.i32Inverter = 0;
sPt.u32Frequency = 2000;
DrvPWM_SelectClockSource ( DRVPWM_TIMER0, DRVPWM_HCLK);
DrvPWM_SetTimerClk( DRVPWM_TIMER0, &sPt);
DrvPWM_SetTimerIO ( DRVPWM_TIMER0, 1);
DrvPWM_Enable ( DRVPWM_TIMER0, 1);
while(1);
} |