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.

Could you explain some codes related to USB-Serial in LaunchPad-F28377S?

Other Parts Discussed in Thread: CONTROLSUITE

Hi, everyone,

To use serial communication (SCI-A) in the launchpad-F28377S, I referred demo source code in the controlsuite.

Finally, I found that    when I remove below codes in the source code

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//Redirect STDOUT to SCI
status = add_device("scia", _SSA, SCI_open, SCI_close, SCI_read, SCI_write, SCI_lseek, SCI_unlink, SCI_rename);
fid = fopen("scia","w");
freopen("scia:", "w", stdout);
setvbuf(stdout, NULL, _IONBF, 0);

////////////////////////////////////////////////////////////////////////////////////////////////////////////

serial communication did not work.  (I can not receive any data from the PC).

Could anyone explain me the above codes?   In fact, I do not find any document related to the above code.  It seems to be related to the FT2232H chip for serial communication mode.

I really appreciate if you give me useful information or let me know useful document for these codes.

Thank you.

  • Please see the F2837x_sci_echoback example in controlSUITE.

    You will need to modify the example for the Launchpad a little. The example is built for a 20MHz XTAL (external crystal/ clock) but the Launchpad uses a 10MHz XTAL. Also, the example uses GPIO 28/29. You should change them to use GPIO 85/84 for the Launchpad.

    The Launchpad has GPIO 85/84 connected to the FTDI chip on the Launchpad whic muxes the signals to the USB connector. So, GPIO 85/84 can be used for serial communication from the USB connector.

    sal
  • Thank you for your reply.

    Interestingly, using below codes, SCI works well.

    EALLOW;
    GpioCtrlRegs.GPCMUX2.bit.GPIO84 = 1;
    GpioCtrlRegs.GPCMUX2.bit.GPIO85 = 1;
    GpioCtrlRegs.GPCGMUX2.bit.GPIO84 = 1;
    GpioCtrlRegs.GPCGMUX2.bit.GPIO85 = 1;
    EDIS;

    However, when I used following functions, SCI didn't work.

    // Receiver
    GPIO_SetupPinMux(85, GPIO_MUX_CPU1, 1);
    GPIO_SetupPinOptions(85, GPIO_INPUT, GPIO_PUSHPULL);
    // Transmitter
    GPIO_SetupPinMux(84, GPIO_MUX_CPU1, 1);
    GPIO_SetupPinOptions(84, GPIO_OUTPUT, GPIO_ASYNC);


    I do not know why the above codes do not work. If someone explain the reason, I really appreciate it. ^^
  • GPIO MUX positioning for SCITX & RX is 5 and not 1. Please go through the datasheet.

    Regards,
    Gautam