如题,我使用的是STM8S003系列的单片机,在做PWM控制的时候,TIM1通道3可以输出PWM信号了,可是同样是TIM1通道1怎么就没有PWM信号输出呢。初始化配置如下
TIM1_TimeBaseInit(0, TIM1_COUNTERMODE_UP,115 , 0);
// 整流CH1
TIM1_OC1Init(TIM1_OCMODE_PWM2, TIM1_OUTPUTSTATE_ENABLE, TIM1_OUTPUTNSTATE_DISABLE,50,\
TIM1_OCPOLARITY_HIGH, TIM1_OCNPOLARITY_HIGH, TIM1_OCIDLESTATE_SET, TIM1_OCNIDLESTATE_RESET);
// TIM1_CCxCmd(TIM1_CHANNEL_1, ENABLE);
// 2A升压PWM
TIM1_OC3Init(TIM1_OCMODE_PWM2, TIM1_OUTPUTSTATE_ENABLE, TIM1_OUTPUTNSTATE_DISABLE,50,\
TIM1_OCPOLARITY_HIGH, TIM1_OCNPOLARITY_HIGH, TIM1_OCIDLESTATE_SET, TIM1_OCNIDLESTATE_RESET);
// TIM1->DTR=4;
TIM1_Cmd(ENABLE);
(TIM1->BKR |= TIM1_BKR_MOE);
// SYS_POWER_CLOSE; |