求大神指点,我想设计两路pwm输出用TIM3_CH1和TIM3_CH1分别是PA6,和PA7,但是只有PA7能输出,PA6怎么都不能输出,怎么办啊,我真的找不出问题了!
void PWM3_Init(u16 arr,u16 psc)
{
RCC->APB1ENR|=1<<1;
RCC->APB2ENR|=1<<2;
GPIOA->CRL&=0X0FFFFFFF;
GPIOA->CRL|=0XB0000000;
GPIOA->ODR|=1<<7;
GPIOA->CRL&=0XF0FFFFFF;
GPIOA->CRL|=0X0B000000;
GPIOA->ODR|=1<<6;
TIM3->ARR=arr;
TIM3->PSC=psc;
TIM3->CCMR1|=7<<12;
TIM3->CCMR1|=1<<11;
TIM3->CCMR1|=7<<4;
TIM3->CCMR1|=1<<3;
TIM3->CCER|=1<<4;
TIM3->CCER|=0x01;
TIM3->CR1=0x8000;
TIM3->CR1|=0x01;
} |