用PC6做方波信号输入端,
tiM1 通道1上升沿捕获,通道2下降沿捕获,请问TIM1怎么配置,我的配置捕获不到,CC1IF,CC2IF一直为0.(pc6接高低电平时的上升沿与下降沿时间捕获不到),TIM1能跑起来,
PC_DDR &= 0xbf;
PC_CR1 |= 0x40;
TIM1_CCER1 &= 0xee;//禁止输入捕获1,2
TIM1_CCMR1 =0x01;// ch1到ti1fp1
TIM1_CCER1&= 0xec;//ch1 上升沿触发
TIM1_CCMR2 =0x02;// ch2选择 ti1fp2上
TIM1_CCER1|= 0x20;//ch1 下降沿触发 ic2
TIM1_SMCR |=0x54;//选源触发源和触发方式 复位
TIM1_IER |=0x46;//使能中断ch1 ch2
TIM1_CCER1 |= 0x11;//使能输入捕获1,2
TIM1_CR1 |= 0x01;
TIM1_IER |=0x01;