本帖最后由 rlp4355 于 2011-1-14 15:09 编辑
哪位大神帮我看下为什么我用这个程序在m051上试验没有得到一个占空比为50%的方波......................
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);
} |