void tim1_input_capture()
{
TIM1_DeInit();
CLK_PeripheralClockConfig(CLK_Peripheral_TIM1,ENABLE);
TIM1_TimeBaseInit(50, TIM1_CounterMode_Up, 50, 0);
TIM1_ICInit(TIM1_Channel_1,TIM1_ICPolarity_Falling,TIM1_ICSelection_IndirectTI,TIM1_ICPSC_DIV1,0x00);
TIM1_ITConfig (TIM1_IT_CC1,DISABLE);
TIM1_ClearFlag(TIM1_FLAG_CC1);
TIM1_CCxCmd(TIM1_Channel_1,ENABLE);
TIM1_Cmd(ENABLE);
}
刚学stm8 求打什么给说下 为什么 一直 没有捕获 一直停在
while(!TIM1_GetFlagStatus(TIM1_FLAG_CC1));这里
或者给个tim1 输入捕获的列子学习下 |