Page 1 of 1

D21 EXTINT on XIN32 (PA00)

Posted: Tue Nov 03, 2015 10:38 pm
by erudisill
I'm using the code below to configure PA00 (XIN32) for EXTINT0. Checking the registered in the I/O view in Atmel Studio shows they are configured correctly. I have a simple loop printing out a counter and blinking an LED. When I raise PA00 high, the D21 locks up and reboots. The datasheet indicates that I should be able to use PA00/01 as general ports if not enabling the external oscillator, which I'm not.

Any ideas why this is occurring?

Code: Select all

		struct extint_chan_conf config_chan;

		config_chan.gpio_pin = PIN_PA00;
		config_chan.gpio_pin_mux = PINMUX_PA00A_EIC_EXTINT0;
		config_chan.gpio_pin_pull = EXTINT_PULL_NONE;
		config_chan.detection_criteria = EXTINT_DETECT_RISING;
		config_chan.wake_if_sleeping = false;

		extint_chan_set_config(0, &config_chan);

		extint_register_callback(process_irq, 0, EXTINT_CALLBACK_TYPE_DETECT);

		extint_chan_enable_callback(0, EXTINT_CALLBACK_TYPE_DETECT);

Re: D21 EXTINT on XIN32 (PA00)

Posted: Mon Nov 23, 2015 11:33 am
by sarlacii
Hi there

Just off the top of my head, assuming that you're setting the pin up correctly as an external interrupt, then you also need to make sure that you have a vector for it to jump to when the interrupt occurs. Do you have the interrupt callback function in your code (ASF uses extint_callback_t)?

Re: D21 EXTINT on XIN32 (PA00)

Posted: Mon Nov 23, 2015 5:44 pm
by erudisill
Thanks (again) for the reply!

This was on the same board I'm using in my other post regarding "pull to ground on input." In the end, a flaky ground connection on the MCU was the culprit. Once fixed, PA00 worked fine as an input.


Re: D21 EXTINT on XIN32 (PA00)

Posted: Wed Nov 25, 2015 4:05 pm
by sarlacii