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.

TMS320F28075: UART communication over the USB-module

Part Number: TMS320F28075


Hi guys,

I'm trying to create a UART communication by using the USB module to emulate a COM-port. I already looked in the usb_dev_serial example but i have some understanding problems.

My first question is if the example redirects the traffic from UART to the USB module and vice versa internally? Because in the example the UART pins are muxed out:

    //
    // Configure GPIO Pins for UART mode.
    //
    EALLOW;
    GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 1;
    GpioCtrlRegs.GPAPUD.bit.GPIO28 = 0;
    GpioCtrlRegs.GPAQSEL2.bit.GPIO28 = 3;
    GpioCtrlRegs.GPADIR.bit.GPIO28 = 0;

    GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 1;
    GpioCtrlRegs.GPAPUD.bit.GPIO29 = 0;
    GpioCtrlRegs.GPADIR.bit.GPIO29 = 1;
    EDIS;

The Problem is that these pins are already in use. Another confusion exists at the USBGPIOEnable()-function:

void USBGPIOEnable(void)
{
    EALLOW;
    GpioCtrlRegs.GPBLOCK.all = 0x00000000;
    GpioCtrlRegs.GPBAMSEL.bit.GPIO42 = 1;
    GpioCtrlRegs.GPBAMSEL.bit.GPIO43 = 1;

    //VBUS
    GpioCtrlRegs.GPBDIR.bit.GPIO46 = 0;
    //ID
    GpioCtrlRegs.GPBDIR.bit.GPIO47 = 0;

    GpioCtrlRegs.GPDGMUX2.bit.GPIO120 = 3;
    GpioCtrlRegs.GPDMUX2.bit.GPIO120 = 3;
    GpioCtrlRegs.GPDGMUX2.bit.GPIO121 = 3;
    GpioCtrlRegs.GPDMUX2.bit.GPIO121 = 3;
    EDIS;
}

In the function above there's talk of GPIO120 and 121 but the F28075 only got GPIOs up to 94. I also don't know what's the meaning of "ID".

Kind regards

Tom

  • Tom,

    Yes. In this example, what is received by the SCI is transmitted by the USB, and what is received by the USB is transmitted by the SCI.

    ID should not be important or need to be used in this example. You can disregard this. Pins 42 and 43 are the important pins.

    sal
  • Hi,

    so for just emulating a virtual com port I don‘t need the uart module. In the example its just a part of the echo function. Am I right?

    So did i get it right that the usb connection is handled bei cdc (host) an the RX and TX Buffer (controller).

    In the reference manual is written that if the controller should be a device the Vbus must be monitored. But where can I adjust the GPIO in the usb libraries?

    Tom
  • Yes you are correct. Just for exho back.

    Yes it is CDC.

    VBUS monitoring is not supported in the library. You will need to implement this yourself.

    sal