[En-Nut-Discussion] Problem with GpioIrqEnable

zonedar sholder at summitsemi.com
Thu Mar 1 18:03:04 CET 2012


Hi All,

  I'm working on a project where I have to use a GPIO interrupt.    I
apologize if this has been answered before, but in doing several searches
I've not found much on GPIO interrupts.

  My code seems to be hanging up in GpioIrqEnable, specifically at the end
of the call to PioCtlA where it does (gpioa_at91.c):

    /* Enable interrupt. */
    if (enabled) {
        outr(PIOA_IER, _BV(bit));  //Never returns
    } 

Basically it is going into outr and never leaving.

I'm sure I'm missing something but I can't figure it out for the life of me.

I am working with an AT91SAM7X256 and NUT OS 2.0.8 (according to the
configurator).

Here are code snippets:

void
InitializeDSPMonitor(void)
{
    GpioPinConfigSet(NUTGPIO_PORTA, 14, GPIO_CFG_DEBOUNCE);
    GpioIrqDisable(&sig_GPIO1, 14);
    GpioRegisterIrqHandler(&sig_GPIO1, 14, DSP_Irq, NULL);

    printf("Entering InitializeDSPMonitor\n");
    NutThreadCreate("DSP_Mon", DSP_EventMonitor, 0, 2048);

     GpioIrqEnable(&sig_GPIO1, 14);  //Hangs up here
     printf("Leaving InitializeDSPMonitor\n");
}


Thanks!

-Steve






  
-- 
View this message in context: http://old.nabble.com/Problem-with-GpioIrqEnable-tp33422809p33422809.html
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.



More information about the En-Nut-Discussion mailing list