This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Usage of "Gpio_clearInterruptStatus" function



I am using C6748 and have configured 4 interrupts (INT0, INT1, INT2 and INT3) using different GPIO banks (Bank0_Pin12, Bank2_Pin03, Bank4_Pin01 and Bank3_Pin13). I have configured GPIO ints from falling edge trigger only (I have set for falling edge and clear for rising edge on my interrupt setup routine). I have following questions.

(1) Do I need to call "Gpio_clearInterruptStatus" function in my interrupt routine ?

(2) I am getting to ISR routine twice for every interrupt. Is there any setup problem ?

GPIO interrupt setup code as below. ISR routine is setup in DSP-BIOS configuration file.

    pinCmdArg.pin = GPIO_BANK_0_PIN_12;
    pinCmdArg.value = Gpio_Direction_Input;
    Gpio_setPinDir(gpio0, &pinCmdArg);
    pinCmdArg.pin = GPIO_BANK_2_PIN_03;
    pinCmdArg.value = Gpio_Direction_Input;
    Gpio_setPinDir(gpio0, &pinCmdArg);
    pinCmdArg.pin = GPIO_BANK_3_PIN_13;
    pinCmdArg.value = Gpio_Direction_Input;
    Gpio_setPinDir(gpio0, &pinCmdArg);
    pinCmdArg.pin = GPIO_BANK_4_PIN_01;
    pinCmdArg.value = Gpio_Direction_Input;
    Gpio_setPinDir(gpio0, &pinCmdArg);

    Gpio_bankInterruptEnable(gpio0, GPIO_BANK_0);
    Gpio_bankInterruptEnable(gpio0, GPIO_BANK_2);
    Gpio_bankInterruptEnable(gpio0, GPIO_BANK_3);
    Gpio_bankInterruptEnable(gpio0, GPIO_BANK_4);

    Gpio_setFallingEdgeTrigger(gpio0, GPIO_BANK_0_PIN_12);
   Gpio_clearRisingEdgeTrigger(gpio0, GPIO_BANK_0_PIN_12);

    Gpio_setFallingEdgeTrigger(gpio0, GPIO_BANK_2_PIN_03);
   Gpio_clearRisingEdgeTrigger(gpio0, GPIO_BANK_2_PIN_03);

    Gpio_setFallingEdgeTrigger(gpio0, GPIO_BANK_3_PIN_13);
   Gpio_clearRisingEdgeTrigger(gpio0, GPIO_BANK_3_PIN_13);

    Gpio_setFallingEdgeTrigger(gpio0, GPIO_BANK_4_PIN_01);
   Gpio_clearRisingEdgeTrigger(gpio0, GPIO_BANK_4_PIN_01);

Thanks

Jayesh

 

  • Jayesh,

    You posted this question to the BIOS forum, but it seems like this is more of a general device question.  I will move this thread to the device forum in hopes that it will get a faster response there.

    Dave

  • Hi jayesh,

    Jayesh Patel63136 said:

    (1) Do I need to call "Gpio_clearInterruptStatus" function in my interrupt routine ?

    Yes, you need to. For example, you can refer to the BIOS PSP provided sample application - gpioSample_io.c file, function - gpioInputIsr(..)

    Jayesh Patel63136 said:

    (2) I am getting to ISR routine twice for every interrupt. Is there any setup problem ?

    When you insert a card, it generally generates multiple oscillations. And because of this, since there is no debouncing circuitry there are chances of multiple occurances of interrupts. From software side, we may not do anything much. But someone from this forum(Hardware related) can surely help you.

    Hope this helps..

    Also, can please explain your application scenario/ setup?

     

    Thanks & regards,

    Raghavendra