-
NUC131 PWM0 CH2 CH3双通道输出,为啥只有CH2输出呢?
SYS->GPA_MFP&=~(SYS_GPA_MFP_PA14_Msk|SYS_GPA_MFP_PA15_Msk);SYS->GPA_MFP|=(SYS_GPA_MFP_PA14_PWM0_CH2|SYS_GPA_MFP_PA15_PWM0_CH3);//PA14PA15用于PW0-CH2CH3//引脚设置voidPWM_Init(void){PWM_ConfigOutputChannel(PWM0,2,20000,0);PWM_ConfigOutputChannel(PWM0,3,20000,0);PWM_EnableOutput(PWM0,PWM_CH_2_MASK);PWM_EnableOutput(PWM0,PWM_CH_3_MASK);PWM_EnablePeriodInt(PWM0,2,0);PWM_EnablePeriodInt(PWM0,3,0);NVIC_EnableIRQ(PWM0_IRQn);}//初始化请大神们帮忙看下,初次玩新唐请多关照!
2021-11-17 2