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.

how to distinguish cc3200 GPIO from launchpad GPIO

Other Parts Discussed in Thread: CC3200

Hi everyone,

I'm reading the cc3200 datasheet () and I'm reading some topics on the argument, but I don't understand clearly How distinguish the GPIO of cc3200.

If i read the email example, it uses the pins 4 and 15 of the cc3200 that matches with the GPIO 13(Pin 4) and GPIO 22(pin 15).

  Then the GPIO_13 -> GPIOA1_BASE and GPIO_22 ->GPIOA2_BASE.

From the pin multiplexing configuration I see that I can configure the pin as I need, so, if I need of GPIO_13 for pin 4 I must set the pinout #6 that corresponds to GPIO_PIN_5, now if I want to use the GPIO 16, and 17 that matches with pin 7,8

GPIO_16->GPIOA1_BASE and GPIO_17->GPIOA1_BASE and for use them as GPIO_16 and GPIO_17 I must set pinout #6

but for distinguish them I've selected the #2 for 16 and #5 for 17

so in the pinmux I write

//I don't know if I got it right, because I don't understand How set ucPins

    PinTypeGPIO(PIN_07, PIN_MODE_0, false);
    GPIODirModeSet(GPIOA1_BASE, 0x20, GPIO_DIR_MODE_IN);


    PinTypeGPIO(PIN_08, PIN_MODE_0, false);
    GPIODirModeSet(GPIOA1_BASE, 0x20, GPIO_DIR_MODE_IN);

And when I set interrupt for them

MAP_GPIOIntClear(GPIOA1_BASE,GPIO_PIN_1);
MAP_IntPendClear(INT_GPIOA1);
MAP_IntEnable(INT_GPIOA1);
MAP_GPIOIntEnable(GPIOA1_BASE,GPIO_PIN_1);

MAP_GPIOIntClear(GPIOA1_BASE,GPIO_PIN_5);
MAP_IntPendClear(INT_GPIOA1);
MAP_IntEnable(INT_GPIOA1);
MAP_GPIOIntEnable(GPIOA1_BASE,GPIO_PIN_5);

And for the handler


void Button_IF_Init(P_INT_HANDLER S2InterruptHdl,P_INT_HANDLER S3InterruptHdl )
{
    if(S3InterruptHdl != NULL)
    {
        //
        // Set Interrupt Type for GPIO
        //
        MAP_GPIOIntTypeSet(GPIOA1_BASE,GPIO_PIN_2,GPIO_FALLING_EDGE);

        g_S3InterruptHdl = S3InterruptHdl;

        //
        // Register Interrupt handler
        //
#if defined(USE_TIRTOS) || defined(USE_FREERTOS) || defined(SL_PLATFORM_MULTI_THREADED)
    // USE_TIRTOS: if app uses TI-RTOS (either networking/non-networking)
    // USE_FREERTOS: if app uses Free-RTOS (either networking/non-networking)
    // SL_PLATFORM_MULTI_THREADED: if app uses any OS + networking(simplelink)
        osi_InterruptRegister(INT_GPIOA1,(P_OSI_INTR_ENTRY)GPIOs3IntHandler, \
                                INT_PRIORITY_LVL_1);
#else
        MAP_IntPrioritySet(INT_GPIOA1, INT_PRIORITY_LVL_1);
        MAP_GPIOIntRegister(GPIOA1_BASE, GPIOs3IntHandler);
#endif
        //
        // Enable Interrupt
        //
        MAP_GPIOIntClear(GPIOA1_BASE,GPIO_PIN_2);
        MAP_GPIOIntEnable(GPIOA1_BASE,GPIO_INT_PIN_2);
    }

    if(S2InterruptHdl != NULL)
    {
        //
        // Set Interrupt Type for GPIO
        //
        MAP_GPIOIntTypeSet(GPIOA1_BASE,GPIO_PIN_5,GPIO_FALLING_EDGE);

        g_S2InterruptHdl = S2InterruptHdl;

        //
        // Register Interrupt handler
        //
#if defined(USE_TIRTOS) || defined(USE_FREERTOS) || defined(SL_PLATFORM_MULTI_THREADED)
    // USE_TIRTOS: if app uses TI-RTOS (either networking/non-networking)
    // USE_FREERTOS: if app uses Free-RTOS (either networking/non-networking)
    // SL_PLATFORM_MULTI_THREADED: if app uses any OS + networking(simplelink)
        osi_InterruptRegister(INT_GPIOA1,(P_OSI_INTR_ENTRY)GPIOs2IntHandler, \
                                INT_PRIORITY_LVL_1);
#else
        MAP_IntPrioritySet(INT_GPIOA1, INT_PRIORITY_LVL_1);
        MAP_GPIOIntRegister(GPIOA1_BASE, GPIOs2IntHandler);
#endif

        //
        // Enable Interrupt
        //
        MAP_GPIOIntClear(GPIOA1_BASE,GPIO_PIN_1);
        MAP_GPIOIntEnable(GPIOA1_BASE,GPIO_INT_PIN_1);
    }
}

I do not know if I understand it and I would like some clarification on the use of GPIO as previously outlined by me. I see how i did the entire procedure of setting the interrupt as shown in the email.
Also known ever since that GPIO datasheets 26 and 27 are not used, it means that I can not write a program that uses them?

I would also like to use your own configuration as shown in the examples, I can leave SW1 and SW2 to enable the buttons?

  • Hi,

    Have you tried the PinMux tool? processors.wiki.ti.com/.../TI_PinMux_Tool

    Regards,
    Gigi Joseph.
  • Hi,

    yes, I use pinmux tool but pinmux tool set the GPIO as IN or OUT, while I want set an interrupt on this GPIO.
    Also, from pinmux tool the GPIO 26 and GPIO 27 are no selectable. I have a card that use cc3200 and I need to set an interrupt on the GPIOs that I've indicated. I want to know if I've understand as email example set interrupt on the gpio.
  • Any suggestion for my issue?
  • Hi aeromechs,


    //*****************************************************************************
    //
    // The following values define the bit field for the ucPins argument to several
    // of the APIs.
    //
    //*****************************************************************************
    #define GPIO_PIN_0 0x00000001 // GPIO pin 0
    #define GPIO_PIN_1 0x00000002 // GPIO pin 1
    #define GPIO_PIN_2 0x00000004 // GPIO pin 2
    #define GPIO_PIN_3 0x00000008 // GPIO pin 3
    #define GPIO_PIN_4 0x00000010 // GPIO pin 4
    #define GPIO_PIN_5 0x00000020 // GPIO pin 5
    #define GPIO_PIN_6 0x00000040 // GPIO pin 6
    #define GPIO_PIN_7 0x00000080 // GPIO pin 7

    //*****************************************************************************
    //
    // Values that can be passed to GPIODirModeSet as the ulPinIO parameter, and
    // returned from GPIODirModeGet.
    //
    //*****************************************************************************
    #define GPIO_DIR_MODE_IN 0x00000000 // Pin is a GPIO input
    #define GPIO_DIR_MODE_OUT 0x00000001 // Pin is a GPIO output

    //*****************************************************************************
    //
    // Values that can be passed to GPIOIntTypeSet as the ulIntType parameter, and
    // returned from GPIOIntTypeGet.
    //
    //*****************************************************************************
    #define GPIO_FALLING_EDGE 0x00000000 // Interrupt on falling edge
    #define GPIO_RISING_EDGE 0x00000004 // Interrupt on rising edge
    #define GPIO_BOTH_EDGES 0x00000001 // Interrupt on both edges
    #define GPIO_LOW_LEVEL 0x00000002 // Interrupt on low level
    #define GPIO_HIGH_LEVEL 0x00000006 // Interrupt on high level

    //*****************************************************************************
    //
    // Values that can be passed to GPIOIntEnable() and GPIOIntDisable() functions
    // in the ulIntFlags parameter.
    //
    //*****************************************************************************
    #define GPIO_INT_DMA 0x00000100
    #define GPIO_INT_PIN_0 0x00000001
    #define GPIO_INT_PIN_1 0x00000002
    #define GPIO_INT_PIN_2 0x00000004
    #define GPIO_INT_PIN_3 0x00000008
    #define GPIO_INT_PIN_4 0x00000010
    #define GPIO_INT_PIN_5 0x00000020
    #define GPIO_INT_PIN_6 0x00000040
    #define GPIO_INT_PIN_7 0x00000080


    use these MACRO's from driverlib/gpio.h
  • Good afternoon,
    I'm trying to make breaks on pins 55 and 15 I read the datasheet, the button_if example and some forum threads. Teng The problem is that I do not understand that address corresponds or the significance of the GPIOAx_BASE, GPIO_PIN_x, INT_GPIOAx etc ... Could you explain or tell me where I can read it to understand my pin 55, 15 and should define schedule.

    I hope your answer, thank you very much.