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.

TMS320F280041: GPIO Init procedure fails on GPIO 23 shared with internal DC-DC regulator

Part Number: TMS320F280041
Other Parts Discussed in Thread: C2000WARE

Hello Guys,

we have an issue with the INIT of GPIO23 as output GPIO.

From technical reference manual for 28004X: TMS320F28004x Technical Reference Manual sprui33a.pdf
NOTE: GPIO22 and GPIO23 are in a special analog mode at reset, and must be reconfigured for GPIO use by clearing their bits in GPAAMSEL.

I verified   DCDCCTL: DCDCEN = 0x00 ( DC-DC not used ).

My code is as following:

ANALOG_Subsystem.DCDCCTL.AsWord &= ~0x0001;  // Write 0 to enable bit.

IOModule.GPIO_CTRL.GPAAMSEL.Items.GPIO_23 = 0;

IOModule.GPIO_CTRL.GPAODR.Items.GPIO_23   = 0;
IOModule.GPIO_CTRL.GPAPUD.Items.GPIO_23   = GPIO_PU_DISABLE;
IOModule.GPIO_CTRL.GPAGMUX2.Items.GPIO_23 = 0;
IOModule.GPIO_CTRL.GPAMUX2.Items.GPIO_23  = 0;     // use as I/O
IOModule.GPIO_CTRL.GPADIR.Items.GPIO_23   = 1;

But it seems the output is not working as expected. Clearing or toggling is not executed by the pin.

For GPIO22 I did succeed with the same procedure.

Where I'm wrong or what did I miss?

Thanks in advance,

Marco

  • Hi Marco,

    A few questions:
    1. Are you toggling GPIO23 at some frequency?
    2. Is GPIO23 connected to anything on the board?
    3. Did you create your own header files?
  • Hi Frank,

    1. and 2. I read the paragraph about the frequency limitation on that pin. We have a LED connected to that pin that we want to toggle with max. 5 Hz.

    I connected a 100k pullup resistor on the pin.

    The cathode of a green LED is connected via a 1k series resistor to the pin => the pin has to sink some current (therefore logically low active) to get the LED activated.

    But the pin is always at high level. Even setting the gpio-toggle bit within CCS does not have any effect.

    3. Yes we have our own header files as we have a lot of different projects that are several years old with the 240x-DSPs to newest piccolos and we reuse existing code.

    Regards,

    Marco

  • Marco,

    The only restriction on that pin that I'm aware of is the frequency limitation so you shouldn't be seeing this. However, since you are using custom header files, as of right now, i can only point to that being the issue. Just for testing purposes, can you use our support files in C2000Ware to test this? You can use any of the gpio examples as a base.
  • Frank,

    after having checked the init process as well as compared our own header files to the device datasheet and the C2000Ware examples I can now state the correct functionality of the pin with the init procedure stated above.

    The SW was absolutely correct but a very small amount of solder did short 2 pads in another region of the HW and as a result always tied the GPIO to a 3.3V level.

    Thanks for your support.

    Regards,

    Marco

  • Glad to hear you figured it out! Let us know if you have anymore questions.