This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

usb bulk driver

Hi all,
I am using LPC2148 microcontroller. Bulk driver for usb2.0 full speed is written. Currently only 64 bytes of data is written to the endpoint. So the speed achieved is less. I have read in the books that maximum 19 packets of 64 byte length can be transmitted in 1ms frame. How can i increase the speed of bulk transfer.

Parents
  • When you have large data on a buffer, more than 64 bytes, you may see greater transfer speed.

    The firmware declares these global variables,
    - a transfer buffer
    - data size on the buffer
    - index on the buffer
    - a occupied flag

    data size, index and flag are initialized in Set_Configuration request handler

    In the ISR of the bulk IN EP,
    1) If occupied flag drops, return
    2) Call Select Endpoint command of the protocol engine, and get F/E bit of the bulk IN EP
    3) If F/E bit is 0 (next buffer is empty), - pass next packet from the index on the buffer to the IN endpoint - The packet size is the smaller one, data size or 64 bytes else return
    4) Increase index by this packet size, decrease data size by this packet size
    5) If data size is 0, drop occupied flag and return else back to 2)

    Outside of the ISR, firmware starts transfer, when occupied flag drops.
    1) Fill data to the buffer, set data size
    2) Clear the index and raise the occupied flag
    3) Force bulk EP interrupt by USBEpIntSet register

    In this way, your firmware uses the double buffer effectively, and gets top speed.

    Tsuneo

Reply
  • When you have large data on a buffer, more than 64 bytes, you may see greater transfer speed.

    The firmware declares these global variables,
    - a transfer buffer
    - data size on the buffer
    - index on the buffer
    - a occupied flag

    data size, index and flag are initialized in Set_Configuration request handler

    In the ISR of the bulk IN EP,
    1) If occupied flag drops, return
    2) Call Select Endpoint command of the protocol engine, and get F/E bit of the bulk IN EP
    3) If F/E bit is 0 (next buffer is empty), - pass next packet from the index on the buffer to the IN endpoint - The packet size is the smaller one, data size or 64 bytes else return
    4) Increase index by this packet size, decrease data size by this packet size
    5) If data size is 0, drop occupied flag and return else back to 2)

    Outside of the ISR, firmware starts transfer, when occupied flag drops.
    1) Fill data to the buffer, set data size
    2) Clear the index and raise the occupied flag
    3) Force bulk EP interrupt by USBEpIntSet register

    In this way, your firmware uses the double buffer effectively, and gets top speed.

    Tsuneo

Children