D21 EXTINT on XIN32 (PA00)

Discussions around product based on ARM Cortex M0+ core.

Moderator: nferre

erudisill
Posts: 5
Joined: Fri Mar 13, 2015 11:13 pm

D21 EXTINT on XIN32 (PA00)

Tue Nov 03, 2015 10:38 pm

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;
		extint_chan_get_config_defaults(&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);
sarlacii
Posts: 68
Joined: Mon Jan 26, 2015 2:33 pm

Re: D21 EXTINT on XIN32 (PA00)

Mon Nov 23, 2015 11:33 am

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)?
erudisill
Posts: 5
Joined: Fri Mar 13, 2015 11:13 pm

Re: D21 EXTINT on XIN32 (PA00)

Mon Nov 23, 2015 5:44 pm

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.

-Eric
sarlacii
Posts: 68
Joined: Mon Jan 26, 2015 2:33 pm

Re: D21 EXTINT on XIN32 (PA00)

Wed Nov 25, 2015 4:05 pm

:wink:

Return to “SAM D20 Cortex-M0+ MCU”

Who is online

Users browsing this forum: No registered users and 3 guests