AnsweredAssumed Answered

How does Timer implement to the EXTI ?

Question asked by Carter Lee on Oct 13, 2017
Latest reply on Oct 14, 2017 by KIC8462852 EPIC204278916

Hi,

 

Currently, I'm trying to implement the Timer to the EXTI.

Especially, I'd like to watch the toggle input signal by EXTI in limited time.

 

and I want to make a ACK signal like the following image

If I set the count 3 toggle signal but real input signal is 2 then turn on the Timer then what if there is nothing toggling signal in limited time then I want to make ACK is 0.

 

So I've implemented the Timer which was I could set the time period.

But the problem is my implementation is suck and kill me.

 

I need your help. How do I implement watching to the periodic  toggle input signal by EXTI in limited time ?

If input toggle signal active high while in limited time, then I want to set "ack" to 1, if not ack to 0.

 

Could you please help me how do I implement this?

 

 

...

int toggle_count = 0;

main()

{

 

...

capture() {

toggle_count = 0;

capture_toggling = 3; // this is start signal as being triggerring once by external. 

}

 

}

 

void TIM2_IRQHandler(void)

{

    if(TIM_GetITStatus(TIM2,TIM_IT_Update) != RESET)

    {

ack = 0x00; // there is no capture signal in limited time.

TIM_Cmd(TIM2, DISABLE); // Could I use Timer like this?

                                               //

TIM_ClearITPendingBit(TIM2, TIM_IT_Update); // Clear the interrupt flag

 

    }

}

 

void EXTI1_IRQHandler(void)

{

 

  if(EXTI_GetITStatus(EXTI_Line1) != RESET)

  {

count++;

ack = 0x01; // capture toggling signal

 

TIM_Cmd(TIM2, ENABLE); // Could I use Timer like this?

                                             // EXTI watching the toggling signal.

                                             // If capture the toggling signal then TIM_Cmd Eanble

 EXTI_ClearITPendingBit(EXTI_Line1);

  }

}

 

Could you  help me please?

Outcomes