AnsweredAssumed Answered

capture compare problem, interrupt time capture question

Question asked by Spell on Jan 26, 2012
Latest reply on Jan 29, 2012 by Spell

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 behind

this lines. I also tryed to give a delay direct befor the while with

a very little timedelay. But I alwas have the same problem. The same

line 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 an

external Signal on the ports (I did not use the ISR). To get the

value of timer2 during this signal I use "GetCounter". But if my

signal on the port is a bounced signal which value do i get? The

value from the last valid potencial level or is the first value

locked and the value can change first if i reset the CC-Flag?



.
Thank you for helping me.

Outcomes