ATSAMD20E17A Atmel Start External IRQ latency

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've created a start project for the Atmel ATSAMD20E17A device and I haven't added much code beyond the auto generated files that the Start project creates.  I'm able to internally clock the CPU at 48Mhz using the internal PLL and the high accuracy 32k clock source.  I've also created and external interrupt using the callback method and I'm noticing that it's taking a very long time to hit the interrupt handler.


My code is very simple, in main.c I have a GPIO pin (PA01) set to output that is jumpered to the EXTINT3 pin (PA19) set as input rising edge triggered with no filtering.  The driving output is set high for 1 clock cycle and the it's forced low for 20 iterations thru a for loop.  The ISR 1 task to set PA22 high in the ISR and clear when it's back in main after the for loop.  Using a scope on the pins, I'm seeing that it's taking almost 5us to reach the ISR.


This is the code slice.


/* Configure the external interrupt to detect the rising edge on PA19 */



       while (1) {        

             gpio_set_pin_level(PA01, true);                  

             for (uint32_t i = 0; i<20; i++)




             gpio_set_pin_level(PA22, false);       


in the startup code.

/* this is my ISR */

static void button_on_PA19_pressed(void)


       gpio_set_pin_level(PA22, true);


In the scope trace you'll see PA01 on channel 1 that is driving the the EXTINT3 pin.  On channel 2 you'll see that after the rising edge of PA01, PA22 is set in the ISR and cleared again after the for loop in main.  The timebase is 2.5us per division. 


Is it possible I don't have the correct configuration somewhere?  Any help with this problem is greatly appreciated.