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.

TMS320F280049: GPIO23 pin_map.h

Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE, DRV8323

I think there is a bug

If I do not mistake, GPIO23 can only be GPIO23_VSW / VSW

But under:

C2000Ware_3_04_00_00\driverlib\f28004x\driverlib\pin_map.h

#define GPIO_23_GPIO23_VSW 0x00080E00U
#define GPIO_23_EQEP1_INDEX 0x00080E01U
#define GPIO_23_SCIB_RX 0x00080E03U
#define GPIO_23_GPIO23 0x00080E04U
#define GPIO_23_SPIB_STE 0x00080E06U
#define GPIO_23_SD1_C4 0x00080E07U
#define GPIO_23_LINA_RX 0x00080E09U

Regards,

Shlomi

  • Hi Shlomi,

    I think you are correct. 23 is only be used as GPIO23_VSW. I will check and get back to you on why other mux options are available in the header file

    Regards,

    Veena

  • Thanks

    BTW for me GIPO23 works only as input, GIPO22 works good in both ways. 

    To exclude problem in PCB,  I  wired GPIO5  to the same GPIO23 pad, set GPIO23 as input  GPIO5 as output, GPIO5 is toggle OK and I can read actual status via "GpioDataRegs.GPADAT.bit.GPIO23" , but I in the opposite direction it is not working (GPIO5 as input GPIO23 as output)

    I using GIPO toggle TI example  "gpio_ex2_toggle" with custom HW (GPIO23 connected to Enable DRV8323 pin).

    Below modification done to  TI example  to activate GPIO22 and 23 and debug:

    EALLOW;

    //Disables DC-DC
    ASysCtl_disableDCDC();

    GPIO_setPadConfig(22, GPIO_PIN_TYPE_STD);
    GPIO_setPadConfig(23, GPIO_PIN_TYPE_STD);

    GPIO_setQualificationMode(22, GPIO_QUAL_SYNC);
    GPIO_setQualificationMode(23, GPIO_QUAL_SYNC);

    GPIO_setMasterCore(22, GPIO_CORE_CPU1);
    GPIO_setMasterCore(23, GPIO_CORE_CPU1);

    //GPIO22, 23 configured as output pins
    GPIO_setDirectionMode(22, GPIO_DIR_MODE_OUT);
    GPIO_setDirectionMode(23, GPIO_DIR_MODE_OUT);

    //GPIO22, 23 intended to use as digital pin
    GPIO_setAnalogMode(22, GPIO_ANALOG_DISABLED);
    GPIO_setAnalogMode(23, GPIO_ANALOG_DISABLED);


    EDIS;

    for(;;)
    {

    //Toggle
    GPIO_togglePin(22);
    GPIO_togglePin(23);

    //Read
    GPIO22 = GPIO_readPin(22);
    GPIO23 = GPIO_readPin(23); //Always read 0

    DEVICE_DELAY_US(3000000); 
    }

  • Hi Shlomi,

    The GPIO23 can act as both input and output. The f28004x Launchpad uses 23 as the LED pin.

    I am not sure why your are facing this issue. Could it be an issue with board you are using. Is it driven low?

    Regards,

    Veena

  • Resistance to ground 9.2k Ohm

    GPIO 5 connected in parallel to this pin and work as expected

    GPIO 22 work as expected

    Maybe the  f28004x Launchpad LED pin is with pull -up?

    Maybe I miss something in SW?

  • Hi,

    GPIO22 and 23 are analog pins by default. You need to follow the following sequence before using them as digital output pins:

        //Disables DC-DC

        ASysCtl_disableDCDC();

        GPIO_setPadConfig(22, GPIO_PIN_TYPE_STD);

        GPIO_setPadConfig(23, GPIO_PIN_TYPE_STD);

         //GPIO22, 23 configured as output pins

        GPIO_setDirectionMode(22, GPIO_DIR_MODE_OUT);

        GPIO_setDirectionMode(23, GPIO_DIR_MODE_OUT);

         //GPIO22, 23 intended to use as digital pin

        GPIO_setAnalogMode(22, GPIO_ANALOG_DISABLED);

        GPIO_setAnalogMode(23, GPIO_ANALOG_DISABLED);

    Regards,

    Veena

  • Hi veena

    Yes using the same sequence  (with TI example  "gpio_ex2_toggle").

    GPIO setup is done just before the  "for(;;)" loop, see my second post for the code.

    If I change GPIO23 direction to input  it works as input.

    If I also remove line GPIO_setAnalogMode(23, GPIO_ANALOG_DISABLED); it stops working as input.  ( verify that it was in DIGITAL mode.)

    Maybe the  f28004x Launchpad LED pin is with pull -up? 

  • Please do not use the other modes. They need to be removed from the SDK. The schematic for the GPIO23 is provided in C2000Ware under boards and documentation. You can review that.

  • Hi just to update

    It was HW problem, VDDIO was not connected to VDDIO_SW

    Thank you for your help.