Skip to main content
jvavra
Associate III
April 1, 2014
Question

External Interrupt Slow to Respond

  • April 1, 2014
  • 1 reply
  • 577 views
Posted on April 01, 2014 at 17:23

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

#stm
    This topic has been closed for replies.

    1 reply

    waclawek.jan
    Super User
    April 1, 2014
    Posted on April 01, 2014 at 21:58

    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