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.

TMS320F28379D: GPIO Code Working on GPIO31 but not on GPIO 2,3,4,5

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE, LAUNCHXL-F28379D, LAUNCHXL-F280049C

Hello Everyone,

I am just getting started with C2000 Launchpad XL Development Kit.

I am facing strange problem with very basic code.

With exact code GPIO31 working but not other GPIO, I tested with multiple GPIO 2,3,4,5 but none of them work.

void main(void)
{
//
// Initializes device clock and peripherals
//
Device_init();

//
// Configures the GPIO pin as a push-pull output
//
Device_initGPIO();

GPIO_setDirectionMode(31U, GPIO_DIR_MODE_OUT);
GPIO_setDirectionMode(2U, GPIO_DIR_MODE_OUT);

while(1)
{
GPIO_writePin(31U, 0);
GPIO_writePin(2U, 0);
DEVICE_DELAY_US(1000000);
GPIO_writePin(31U, 1);
GPIO_writePin(2U, 1);
DEVICE_DELAY_US(1000000);
}
}

  • Piyush,

    I'm not sure what commands are in the Device_initGPIO(); but does it include the following mux options:

    GPIO_setPinConfig(GPIO_2_GPIO2);                // GPIO2 = GPIO2

    This sets the control of pin GPIO2 as IO and not another peripheral.

    There is an example(Gpiosetup) in C2000Ware for GPIO at this path: C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f2837xd\examples\cpu1\gpio\

    This sets up GPIO2 as PWM output, but you can easily change that and other to get what you need.

    Just to make sure, please use the silkscreen on the back of the board to identify the pin function and not the silk on the top side which is just numerical Jumper position.

    I mention this because GPIO31 is unique in that it goes to an LED and need not be probed.  For instance GPIO2 is P02 on the back silk, and corresponds to J4-38 if you are using the top side silk.

    The diagram in the quick start guide shows this graphically:

    https://www.ti.com/lit/sprui73

    Best,

    Matthew

  • Hi Matthew,

    Thankyou very much I have spent allmot 8hour, and check all possiblity software side, 

    But the problem was as you mention GPIO number is back side of board which I never see.

    Just wondering what is use of number provided on top side of board. that's not even pin number of part as it not follow second row?

    Thanks 

    Piyush Verma

  • Piyush,

    The top side silk is the schematic label for the component like J4 or J2 and then position, but not related to the pin name on the F28379D.

    Schematic is here: https://dev.ti.com/tirex/explore/node?node=AJolQXOu5LcQJpDOhsVzkg__FUz-xrs__LATEST

    Another example would be a different LaunchPad, like LAUNCHXL-F280049C.  Its top side silk would likely be the same as the LAUNCHXL-F28379D, but the connected GPIO could be different depending on the function we need to bring to the pin.

    Best regards,

    Matthew