Question
capture compare problem, interrupt time capture question
Posted on January 26, 2012 at 10:28
I need a delay in a timer 4 interrupt. To realize this I wrote the the follow lines:
if
(TIM_GetITStatus(TIM4, TIM_IT_CC1) == SET) { TIM_ClearITPendingBit(TIM4, TIM_IT_CC1); TIM_ClearFlag(TIM4, TIM_FLAG_CC3);while
(TIM_GetFlagStatus(TIM4, TIM_FLAG_CC3) == RESET); . . . . but instead a delay I sometimes get a lose of some actions behindthis lines. I also tryed to give a delay direct befor the while witha very little timedelay. But I alwas have the same problem. The sameline with an other timer in an other part of the program workes good.What is wrong?.The second question I have is: I use timer 2 to set a CC flag by anexternal Signal on the ports (I did not use the ISR). To get thevalue of timer2 during this signal I use ''GetCounter''. But if mysignal on the port is a bounced signal which value do i get? Thevalue from the last valid potencial level or is the first valuelocked and the value can change first if i reset the CC-Flag?.Thank you for helping me.