2015-07-24 05:19 PM
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 codevoid TIM2_IRQHandler(void){ //TIM_ClearITPendingBit(TIM2, TIM_IT_Update); assert_param(IS_TIM_ALL_PERIPH(TIM2)); TIM2->SR = (uint16_t)~0x0001; //////Enable pin wait.(1us) for(a=0;a<33;a++){ GPIOB->BSRRL = GPIO_Pin_0; } //wait(300ns) for(a=0;a<10;a++){ GPIOB->BSRRH = GPIO_Pin_0;} //one more short pulse(20ns) GPIOB->BSRRL = GPIO_Pin_0; GPIOB->BSRRH = GPIO_Pin_0;}2015-07-24 06:16 PM
Please don't [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32f407%20MCU%20two%20interrupts%20at%20some%20time&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx¤tviews=3]cross post into multiple forum.