NUC029 BSP中PWM_DutySwitch例程,步进调试时,占空比在配置完成并不马上输出 keil5下,调试PWM_Start(PWM0, PWM_CH_0_MASK | PWM_CH_1_MASK);并不能马上输出占空比? 代码如下 /* Enable output of PWM0 channel 0 */ PWM_EnableOutput(PWM0, PWM_CH_0_MASK | PWM_CH_1_MASK);
/* Start PWM counter */ PWM_Start(PWM0, PWM_CH_0_MASK | PWM_CH_1_MASK);
while(1) { printf("\nSelect new duty: \n"); printf("[1] 100%% \n"); printf("[2] 75%% \n"); printf("[3] 25%% \n"); printf("[4] 0%% \n"); printf("[Other] Exit \n"); u8Option = getchar();(一定要步进到这里才能输出占空比) 怎样做,才能在改变比较值后实时输出占空比?
|