AnsweredAssumed Answered

STM32f407 MCU two interrupts at some time

Question asked by park.homin on Jul 25, 2015
Latest reply on Jul 25, 2015 by park.homin
I used TIMER 2. It's interrupt time is 1us.
I made one long pulse and short pulse using GPIO output pin and TIMER 2.
but sometimes, interrupts occurred two times.

First figure is the result I want to get.
Second figure is the result I can get now.

At second figure the red circle is an error I think.
It's shivering in trigger mode.

Here is my code

void TIM2_IRQHandler(void)
     //TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
     TIM2->SR = (uint16_t)~0x0001;

     //////Enable pin wait.(1us)

     GPIOB->BSRRL = GPIO_Pin_0;

     GPIOB->BSRRH = GPIO_Pin_0;}

     //one more short pulse(20ns)

     GPIOB->BSRRL = GPIO_Pin_0;
     GPIOB->BSRRH = GPIO_Pin_0;