1. 是否使用别的时钟模式就可以进入捕获中断,如果不是先把进捕获中断搞定;
2、如果别的时钟模式可以进捕获中断,那就重点检查下基于ETR的配置代码。请参考手册中的流程:
1. As no filter is needed in this example, write ETF[3:0] = 0000 in the TIM1_ETR register.
2. Set the prescaler by writing ETPS[1:0] = 01 in the TIM1_ETR register.
3. Select rising edge detection on the ETR pin by writing ETP = 0 in the TIM1_ETR
register.
4. Enable external clock mode 2 by writing ECE = 1 in the TIM1_ETR register.
5. Enable the counter by writing CEN = 1 in the TIM1_CR1 register.
The counter counts once every two ETR rising edges.
【具体参数根据你的应用稍作调整】