2014-04-01 08:23 AM
I've got an external interrupt configured for an IO pin. It is configured for rising edge:
/* Select the EXTI Line7 as the GPIO pin source */ SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOB, EXTI_PinSource7); EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; EXTI_InitStructure.EXTI_Line = EXTI_Line7; EXTI_InitStructure.EXTI_LineCmd = NewState; EXTI_Init(&EXTI_InitStructure); EXTI->PR = EXTI_Line7; Further, it as set up as the highest priority: /* EXTI INT needs to preempt the SPI INTs, so must be higher priority */ NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); However, by toggling an IO line high when I enter the ISR for this interrupt, I can see that frequently it is taking almost 60uS to respond. I have captured this on the scope: CH3 shows the event that should trigger the ISR, while CH1 shows the GPIO getting toggled high as soon as I enter the ISR. The first event triggers an almost immediate response (under 2uS), while the second takes around 60uS. Anyone have any idea why this interrupt is taking so long? #stm2014-04-01 12:58 PM
Try to write a simple minimal test program with nothing but the ISR you described (and an infinite loop in main after things are initialized).
Still long responses to the input? JW