Counting Rising Edge
Hello
I use STDPERIPH_DRIVER .I want Counting a pulse and when it arrive to special number (100 Rising edge) I get an interrupt.How can i do that?
I do somthing like that
TIM_ICInitStructure.TIM_Channel = TIM_Channel_4;
TIM_ICInitStructure.TIM_ICPolarity = TIM_ICPolarity_Rising; TIM_ICInitStructure.TIM_ICSelection = TIM_ICSelection_DirectTI; TIM_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV1; TIM_ICInitStructure.TIM_ICFilter = 0x0;TIM_ICInit(TIM3, &TIM_ICInitStructure);
TIM_ITConfig(TIM3, TIM_IT_CC4, ENABLE);
TIM_Cmd(TIM3, ENABLE);
void TIM3_IRQHandler(void)
{if (TIM_GetITStatus(TIM3, TIM_IT_CC4) == SET)
{ TIM_ClearITPendingBit(TIM3, TIM_IT_CC4); time_counter++; if (time_counter == 100) {}
}It work but when i use some mcu they wrok synchronization but after 7 or 8 hours they are not
synchronization and have random delay between them.