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.

one more GPIO Interrupt Not working

Hi

I am Using Code Composer Studio Version: 6.0.1.00040

  Board :-TM4C1294 EVM Kit

 I  add the one more switch and LED for PORTE  PIN0 and PIN1 and Modified the gpiointerrupt Project files  

In  gpiointerrupt.c  add one more function and modified main function, modified  EK_TM4C1294XL.C and Baord.h But still not working What changes need to do

/*

 *  ======== gpiointerrupt.c ========

 */

 

 

void gpioButtonFxn2(void) {

       /* Clear the GPIO interrupt and toggle an LED */

       GPIO_toggle(Board_LED3);

        GPIO_clearInt(Board_BUTTON2);

 

       if (count++ == 100) {

              count = 0;

       }

}

 

/*

 *  ======== main ========

 */

int main(void) {

       /* Call board init functions */

       Board_initGeneral();

       Board_initGPIO();

       Board_initUART();

 

       /* Turn on user LED */

       GPIO_write(Board_LED0, Board_LED_OFF);

       GPIO_write(Board_LED1, Board_LED_OFF);

       GPIO_write(Board_LED3, Board_LED_ON);

 

       System_printf("Starting the GPIO Interrupt example\nSystem provider is set"

                     " to SysMin. Halt the target to view any SysMin contents in"

                     " ROV.\n");

       /* SysMin will only print to the console when you call flush or exit */

       System_flush();

 

       /* Initialize interrupts for all ports that need them */

       GPIO_setupCallbacks(&Board_gpioCallbacks0);

 

       /* Enable interrupts */

       GPIO_enableInt(Board_BUTTON0, GPIO_INT_RISING);

       GPIO_enableInt(Board_BUTTON2, GPIO_INT_RISING);

 

       /*

        *  If more than one input pin is available for your device, interrupts

        *  will be enabled on Board_BUTTON1.

        */

       if (Board_BUTTON0 != Board_BUTTON1) {

 

              /* Need to call setup if the button is on a different port */

              if (&Board_gpioCallbacks0 != &Board_gpioCallbacks1) {

                     GPIO_setupCallbacks(&Board_gpioCallbacks1);

              }

 

              GPIO_enableInt(Board_BUTTON1, GPIO_INT_FALLING);

       }

 

 

       /* Start BIOS */

       BIOS_start();

       return (0);

}

 

 

 

/*

 *  ======== EK_TM4C1294XL.c ========

 *  This file is responsible for setting up the board specific items for the

 *  EK_TM4C1294XL board.

 

/*

 *  =============================== GPIO ===============================

 */

/* Place into subsections to allow the TI linker to remove items properly */

#if defined(__TI_COMPILER_VERSION__)

#pragma DATA_SECTION(GPIO_config, ".const:GPIO_config")

#pragma DATA_SECTION(gpioHWAttrs, ".const:gpioHWAttrs")

#endif

 

#include <ti/drivers/GPIO.h>

 

/* Callback functions for the GPIO interrupt example. */

void gpioButtonFxn0(void);

void gpioButtonFxn1(void);

void gpioButtonFxn2(void);

 

/* GPIO configuration structure */

const GPIO_HWAttrs gpioHWAttrs[EK_TM4C1294XL_GPIOCOUNT] = {

    {GPIO_PORTN_BASE, GPIO_PIN_1, GPIO_OUTPUT}, /* EK_TM4C1294XL_USR_D1 */

    {GPIO_PORTN_BASE, GPIO_PIN_0, GPIO_OUTPUT}, /* EK_TM4C1294XL_USR_D2 */

    {GPIO_PORTJ_BASE, GPIO_PIN_0, GPIO_INPUT},  /* EK_TM4C1294XL_USR_SW1 */

    {GPIO_PORTJ_BASE, GPIO_PIN_1, GPIO_INPUT},   /* EK_TM4C1294XL_USR_SW2 */

    {GPIO_PORTE_BASE, GPIO_PIN_0, GPIO_OUTPUT},

    {GPIO_PORTE_BASE, GPIO_PIN_1, GPIO_INPUT}

};

 

/* Memory for the GPIO module to construct a Hwi */

Hwi_Struct callbackPortJHwi,callbackPortEHwi;

 

const GPIO_Callbacks EK_TM4C1294XL_gpioPortJCallbacks = {

    GPIO_PORTJ_BASE, INT_GPIOJ, &callbackPortJHwi,

    {gpioButtonFxn0, gpioButtonFxn1, NULL, NULL, NULL, NULL, NULL}

};

 

const GPIO_Callbacks EK_TM4C1294XL_gpioPortECallbacks = {

     GPIO_PORTE_BASE, INT_GPIOE, &callbackPortEHwi,

    { gpioButtonFxn2,NULL,NULL, NULL, NULL, NULL, NULL}

};

 

const GPIO_Config GPIO_config[] = {

    {&gpioHWAttrs[0]},

    {&gpioHWAttrs[1]},

    {&gpioHWAttrs[2]},

    {&gpioHWAttrs[3]},

    {&gpioHWAttrs[4]},

    {&gpioHWAttrs[5]},

    {NULL},

};

 

/*

 *  ======== EK_TM4C1294XL_initGPIO ========

 */

void EK_TM4C1294XL_initGPIO(void)

{

    /* Setup the LED GPIO pins used */

    GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, GPIO_PIN_0 );

 

    /* Setup the button GPIO pins used */

    GPIOPinTypeGPIOInput(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    GPIOPinTypeGPIOInput(GPIO_PORTE_BASE, GPIO_PIN_1);

 

    GPIOPadConfigSet(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1, GPIO_STRENGTH_2MA,

                     GPIO_PIN_TYPE_STD_WPU);

 

    GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_0 , GPIO_STRENGTH_2MA,

                         GPIO_PIN_TYPE_STD_WPU);

 

    /* Once GPIO_init is called, GPIO_config cannot be changed */

    GPIO_init();

}

 

 

 

 

 //**************Board.h  **************************

 

#define Board_LED3                  EK_TM4C1294XL_D3

#define Board_BUTTON2         EK_TM4C1294XL_USR_SW3

  • Muralidhara S.N. Sullia said:

    #define Board_LED3                  EK_TM4C1294XL_D3

    #define Board_BUTTON2         EK_TM4C1294XL_USR_SW3

    Did you update the struct in EK_TM4C1294XL.h for these new values?

    typedef enum EK_TM4C1294XL_GPIOName {
        EK_TM4C1294XL_D1 = 0,
        EK_TM4C1294XL_D2,
        EK_TM4C1294XL_USR_SW1,
        EK_TM4C1294XL_USR_SW2,

        EK_TM4C1294XL_GPIOCOUNT
    } EK_TM4C1294XL_GPIOName;

    Also, do you see any output in ROV, in the SysMin view?

    Steve

  • Hi Steve

    I have Update EK_TM4C1294XL.h file. Not getting any Output . what is the full form of ROV ?

    /*!
    * @def EK_TM4C1294XL_GPIOName
    * @brief Enum of LED names on the EK_TM4C1294XL dev board
    */
    typedef enum EK_TM4C1294XL_GPIOName {
    EK_TM4C1294XL_D1 = 0,
    EK_TM4C1294XL_D2,
    EK_TM4C1294XL_USR_SW1,
    EK_TM4C1294XL_USR_SW2,
    EK_TM4C1294XL_D3,
    EK_TM4C1294XL_USR_SW3,

    EK_TM4C1294XL_GPIOCOUNT
    } EK_TM4C1294XL_GPIOName;

    Regards,

     Muralidhara 

  • Muralidhara,

    ROV is the "RTOS Object Viewer" and can provide you with insight into the kernel and your app.  You can open it in CCS via the tools menu.  Note that your application must be in the halted state.

    Once in ROV, look for SysMin: