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.

How to write to USB Endpoint on MSP4305529

Other Parts Discussed in Thread: MSP430F5510

Hi,

I'm new with USB and I downloaded CDC/HID example code for MSP4305529. I would like to to use bulk transport for my data and don't want to use HID or CDC. Has anyone done this with the current example?

I think in order to write to Endpoint I need to write to some buffer. If I want to send data from a device to the host PC then I would need to load some data to a buffer for endpoint IN. Am I correct?

Thanks for your help

Mario

  • Hi msp_div,

    the USB CDC API (USB Communications Device Class Application Programming Interface) should be your starting point if you don't want to write your own USB stack! It should give you the throughput for full-speed USB communication (HID class is limited to 64KB/sec).

    To the USB host, the connection appears as a virtual COM port, which is a very simple and commonly-used interface. To the MSP430’s software, it appears as a data interface that is accessible with simple API calls, such as “open/close the connection”, “send/receive data”, etc. The purpose of this API is the establishment of a COM port on the USB host, through which an application on the host can communicate with an MSP430 over USB. On the MSP430 side, the (virtual) PC COM port is associated with a simple data interface, through which data is transceived with the host. Calls are available to accomplish this, at a level of complexity similar to that of a basic UART. So, there's no need your you to re-invent the wheel.

    Pls note: The CDC API is limited to a single End-Point at the moment!

    Kind regards
    aBUGSworstnightmare

  • Thanks aBUGSworstnightmare,

    I forgot to mention that I don't want to use either CDC or HID class. I will use my own driver.

    I was going through example code for CDC/HID and I couldn't find a function that allows me to write to Endpoint. What I was expecting was a function like this:

    "Write_to_EP(*EP, *buffer, size); ".    However I couldn't find that yet. I think HID and CDC work on interrupt endpoints and I want BULK endpoints.

     

    Thanks

    Mario

  • Hi Mario,

    this is from the CDC API:

     

    /*----------------------------------------------------------------------------
    These functions can be used in application
    +----------------------------------------------------------------------------*/

    /*
    Sends data over interface intfNum, of size size and starting at address data.
      Returns:  kUSBCDC_sendStarted
                kUSBCDC_sendComplete
                kUSBCDC_intfBusyError
    */
    BYTE USBCDC_sendData(const BYTE* data, WORD size, BYTE intfNum);

    /*
    Receives data over interface intfNum, of size size, into memory starting at address data.
    */
    BYTE USBCDC_receiveData(BYTE* data, WORD size, BYTE intfNum);

    ...

    'think you were looking for this (find it in UsbCdc.h in the folder(s) USB_CDC_API of all examples)?

    aBUGSworstnightmare

     

  • Thanks aBUGSworstnightmare,

    I was looking for something like that yes. I tried using that function but it seems my device goes to suspend mode after enumeration and when I use BYTE USBCDC_sendData() it doesn't send any data because it's in suspend mode.  

    I did a quick search online and found that a device goes into suspend mode if there is no activity on the BUS for longer than 3ms. That's interesting because it seems like I would need to send "something" on the bus all the time. I read about sending start of frame packets or something like that to keep bus active, I'm not sure if that's true.

    I was hoping that I wouldn't have to rewrite the entire stack to get it working with bulk transfer Endpoint type.

    Thanks

    Mario

  • Hi Mario,

    can you please tell me how to configure Interrupt endpoint for msp430f5510,there is no option in endpointcfg block

     

     

     

    Thanks

    Spandana

**Attention** This is a public forum