AnsweredAssumed Answered

External Interrupt Slow to Respond

Question asked by Joshua on Apr 1, 2014
Latest reply on Apr 1, 2014 by waclawek.jan
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?

http://i61.tinypic.com/25gwbhl.jpg

Outcomes