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.

TMS320F28388D: GPIO Output Problems

Part Number: TMS320F28388D
Other Parts Discussed in Thread: TMDSCNCD28388D, TMDSHSECDOCK,

I am working with the TMS320F28388D on the TMDSCNCD28388D Control Card (Eval Board) used in the 180-pin TMDSHSECDOCK docking station.

Everything has been working good with this board until I tried an output on one of the GPIOs. It outputs correctly, but it seems to corrupt 2 other GPIO outputs.

Specifically, I am turning on LED1 and LED2 on the board by outputting LOW from GPIO 31 and 34, respectively, since they are wired to turn on with a GPIO LOW output.
This works good by doing this:
GpioDataRegs.GPADAT.bit.GPIO31 = 0; // Turn on LED1.
GpioDataRegs.GPBDAT.bit.GPIO34 = 0; // Turn on LED2.

Next, I try to turn on LED1 and turn off LED2 by writing 0 and 1 to GPIO 31 and 34, respectively like this:
GpioDataRegs.GPADAT.bit.GPIO31 = 0; // Turn on LED1.
GpioDataRegs.GPBDAT.bit.GPIO34 = 1; // Turn off LED2.

and this works fine.

However, if I then output HIGH from GPIO45 by doing this (which is not connected to any LED, just a scope probe).

GpioDataRegs.GPBDAT.bit.GPIO45 = 1;

this correctly outputs a high from GPIO45

BUT

both LEDs turn on immediately, indicating that both GPIO31 and GPIO34 have both gone back to output of 0.

If I then reverse the order setting GPIO45 before GPIO31 and GPIO34 everything is fine: LED1 is ON, LED2 is OFF, and GPIO45 output is HIGH.

Any ideas why reversing this order gets rid of that glitch-like behavior?

Thanks.

Any ideas why this would be happening.

  • I'd recommend you use the GPxSET, GPxCLEAR, and GPxTOGGLE registers to modify the GPIO pin states. With the GPxDAT registers you are reading and writing a total of 32 GPIOs at the same time which can lead to problems (see TRM section "GPyDAT Registers" under "Digital General-Purpose I/O Control" section). With the other registers are you guaranteed to be modifying only a single GPIO at a time.

  • That worked, thank you. To recap, When I did this

    GpioDataRegs.GPADAT.bit.GPIO31 = 0; // Turn on LED1.
    GpioDataRegs.GPBDAT.bit.GPIO34 = 1; // Turn off LED2.
    GpioDataRegs.GPBDAT.bit.GPIO45 = 1; // Output a HIGH

    the last instruction (for GPIO45) corrupted GPIO31 and GPIO34  so that they were both set LOW, but when I changed the GPIO45 instruction to this per your recommendation

    GpioDataRegs.GPBSET.bit.GPIO45 = 1; // Output a HIGH

    This solved the problem.

    Just to be sure (per the section you referenced in the Technical Reference Manual) I also changed the first 2 instructions so using this, which works fine:

    GpioDataRegs.GPACLEAR.bit.GPIO31 = 1; // Turn on LED1
    GpioDataRegs.GPBSET.bit.GPIO34 = 1; // Turn off LED2
    GpioDataRegs.GPBSET.bit.GPIO45 = 1; // Output a HIGH