STM8S207,使用TIM1通道1做输入捕捉,代码如下:
TIM1_ICInit(TIM1_CHANNEL_1,TIM1_ICPOLARITY_FALLING,TIM1_ICSELECTION_DIRECTTI,TIM1_ICPSC_DIV1,0x0);
TIM1_ITConfig(TIM1_IT_CC1,ENABLE);
TIM1_ClearFlag(TIM1_FLAG_CC1);
TIM1_Cmd(ENABLE);
CPU频率用外部晶体18.432M,AFR5也设置成了第二功能,port B0也设置成了输入,可是就是捕捉不到外部信号,外部信号12K |