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.

F28377D USB-Serial communication (usb_dev_serial)

Other Parts Discussed in Thread: CONTROLSUITE

Dear all, 

I just got a new F28377D controlCard board. 

I need to communicate it with PC via USB-Serial communication. 

I found one example project from controlSUITE called usb_dev_serial. 
I loaded this example project to the controlCard board, and tried to send character from PC via serial communication software. 


My PC has recognized an active COM port for this board, which is COM6. 

As far as I understand from the documentation of this example project, I would get an echo from the board.
However, i didn't get anything. 


Could anyone please share with me any example code for serial communication using F28377D microcontroller ?

Thank you. 

  • Hi,

    ipyd said:

    As far as I understand from the documentation of this example project, I would get an echo from the board.
    However, i didn't get anything. 

    I hope you followed this procedure:

    "Connect USB cables from your PC to both the mini and microUSB connectors on the controlCARD.Figure out what COM ports your controlCARD is enumerating (typically done using Device Manager in Windows) and open a serial terminal to each of with the settings 115200 Baud 8-N-1.  Characters typed in one terminal should be echoed in the other and vice versa."

    Regards,

    Gautam

  • Thank you for your reply Gautam, 


    Yes, of course I have followed that procedure. 

    Below is the while loop in main function of the example code. 

    //
    // Have we been asked to update the status display?
    //
    if(g_ui32Flags & COMMAND_STATUS_UPDATE)
    {
    //
    // Clear the command flag
    //
    IntMasterDisable();
    g_ui32Flags &= ~COMMAND_STATUS_UPDATE;
    IntMasterEnable();

    }

    //
    // Has there been any transmit traffic since we last checked?
    //
    if(ui32TxCount != g_ui32UARTTxCount)
    {
    //
    // Take a snapshot of the latest transmit count.
    //
    ui32TxCount = g_ui32UARTTxCount;

    //
    // Update the display of bytes transmitted by the UART.
    //
    usnprintf(pcBuffer, 16, "%d ", ui32TxCount);

    //
    // Update the RX buffer fullness. Remember that the buffers are
    // named relative to the USB whereas the status display is from
    // the UART's perspective. The USB's receive buffer is the UART's
    // transmit buffer.
    //
    ui32Fullness = ((USBBufferDataAvailable(&g_sRxBuffer) * 100) /
    UART_BUFFER_SIZE);

    }

    //
    // Has there been any receive traffic since we last checked?
    //
    if(ui32RxCount != g_ui32UARTRxCount)
    {
    //
    // Take a snapshot of the latest receive count.
    //
    ui32RxCount = g_ui32UARTRxCount;

    //
    // Update the display of bytes received by the UART.
    //
    usnprintf(pcBuffer, 16, "%d ", ui32RxCount);

    //
    // Update the TX buffer fullness. Remember that the buffers are
    // named relative to the USB whereas the status display is from
    // the UART's perspective. The USB's transmit buffer is the UART's
    // receive buffer.
    //
    ui32Fullness = ((USBBufferDataAvailable(&g_sTxBuffer) * 100) /
    UART_BUFFER_SIZE);

    }

    I have tried to put breakpoints inside all of those if-statement. 
    But the program never stopped in it. 

    If you have, could you please give me one example line which will continuously send character to PC ? 
    I have tried to use UARTCharPut in the while loop, but still I did not receive anything in my PC. 


    Thank you. 
    Ipyd

  • Gautam, 

    Do you have any idea what I should do with the position of A:JW1 switch ? 

    Thank you.

    Ipyd

  • ipyd said:

    If you have, could you please give me one example line which will continuously send character to PC ? 
    I have tried to use UARTCharPut in the while loop, but still I did not receive anything in my PC.  

    Which terminal program are you using? Try hyperterminal from this link:

    http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/171/8154.hypertrm.rar

    You've to paste the dll file present in the rar file into your system32 folder:

    C:\Windows\System32

    Regards,

    Gautam

  • I tried both hyperterminal and Ultra Serial Monitor. 
    None of them are working. 

    What about the position of switch 2 at A:SW1 ? do I need to make it at ON position or OFF position ? 

    Thanks. 

    ipyd

  • ipyd said:
    What about the position of switch 2 at A:SW1 ? do I need to make it at ON position or OFF position ? 

    Refer this pic:

    If your booting from flash : Pos 1 OFF

    for USB-to-UART : Pos 2 ON

    Regards,

    Gautam

  • Hi ipyd,

    I have not ran this example previously but I believe I can help you out some. 

    To run the example you will have 2 hyperterminal windows open:
    * one which will connect to a virtual USB serial port emulated by the C2000 device and connected via J8.  The interface here is fully USB all the way into the C2000 device.
    * one which will connect to a virtual USB serial port emulated by an FTDI device (A:U4) and connected to A:J1.  The interface here is USB to the FTDI chip and then the FTDI will talk to the C2000 device via SCI/UART.

    Any message sent via one hyperterminal should then get sent to the other.

    With regards to A:SW1:
    *position 1 should be in the ON position since you'll be using an emulator
    *position 2 should be in the ON position so that the FTDI chip can communicate to the C2000 device over SCI.

    Hopefully this helps.


    Thank you,
    Brett

  • Brett Larimore said:

    To run the example you will have 2 hyperterminal windows open:
    * one which will connect to a virtual USB serial port emulated by the C2000 device and connected via J8.  The interface here is fully USB all the way into the C2000 device.
    * one which will connect to a virtual USB serial port emulated by an FTDI device (A:U4) and connected to A:J1.  The interface here is USB to the FTDI chip and then the FTDI will talk to the C2000 device via SCI/UART.

    Any message sent via one hyperterminal should then get sent to the other.

    Hi Brett, thank you for your input. 


    Does it mean that my PC should detect two COM ports ? 
    Unfortunately, my PC detected only one COM port.

    Thanks. 

    ipyd

  • ipyd said:
    Does it mean that my PC should detect two COM ports ? 

    Exactly! So any yellow alert symbol on any device in Device Manager? Also, do you've 2 usb cables connected to PC as mentioned in comments?

    Regards,

    Gautam

  • Hi, Gautam

    Gautam Iyer said:

    Exactly! So any yellow alert symbol on any device in Device Manager? Also, do you've 2 usb cables connected to PC as mentioned in comments?



    Hi Gautam, 

    Yes, I connected A:J1 (miniUSB) and J8 (microUSB) to my PC as instructed in the manual. 

    but I did not get any yellow alert symbol in Device Manager. 

    I am wondering if the example project is correct or not. 
    Could you please share with me any working example project ? 

    THanks. 
    Iman. 


  • Iman, here's the example project: 0245.usb_dev_serial.rar

  • Ipyd,

    It's probably easier to use the FTDI serial port directly instead of using the F2837 USB. Can you try using only the emulator serial connection with the sci_echoback example?

  • Ipyd,

    Are you using the latest examples (F2837xD Support Library v120)?

    The previous versions had a bug in the USB examples in line:

      USBStackModeSet(0, eUSBModeDevice, 0);

    Which was changed to:

      USBStackModeSet(0, eUSBModeForceDevice, 0);

    This bug made the USB device not initialize in Windows...John

  • Hi Adam, 

    This is great!

    Thank you for your answer. That is what I am looking for. 



  • J. Gomez said:

    Ipyd,

    Are you using the latest examples (F2837xD Support Library v120)?

    The previous versions had a bug in the USB examples in line:

      USBStackModeSet(0, eUSBModeDevice, 0);

    Which was changed to:

      USBStackModeSet(0, eUSBModeForceDevice, 0);

    This bug made the USB device not initialize in Windows...John



    Hi Gomez, 

    I am using version v110. 

    This is what I am afraid of.
    Code bugs !! 
    because when I tried using usb_dev_bulk, the windows could detect the device.

    Thanks a lot for your feedback.
    I will find out the latest example. 

    Cheers, all.
    Case closed so far. 

    I appreciate all feedback from you guys !