Author Topic: reach to maximum speed of USB with LPC1768  (Read 5710 times)

amir

  • Member
  • ***
  • Posts: 3
reach to maximum speed of USB with LPC1768
« on: March 05, 2016, 09:42:09 am »
Hi
I read most parts of USB complete book but I can't do my work

I want to transfer 1023 bytes each 1 milisecond from LPC1768 (full speed) to computer and read by C# (I use libusbdotnet library in host side and use keil examples in device side)... but I couldn't do it (I know it's possible with isochronous or maybe bulk endpoint)....I just reach to 64 byte each milisecond with USB HID example (as you know it's use interupt endpoint)... I see usbaudio and usbcdc and usbmem keil examples too but I couldn't change it to read bytes in pc side...

I would be thankful if somebody could help me

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: reach to maximum speed of USB with LPC1768
« Reply #1 on: March 05, 2016, 11:15:51 am »
Transferring > 64 bytes/ms isn't possible using a full-speed interrupt endpoint.

Bulk transfers have no guaranteed bandwidth but in theory can transfer up to nineteen 64-byte packets/ms on an otherwise idle full-speed bus. Actual host performance may be less than this, and other bus traffic may have higher priority.

Isochronous can do 1023 bytes/ms but has no error correcting.

On the PC, every call to read data from an application has overhead. To increase the throughput, use larger transfers. In other words, instead of requesting 1023 bytes, request 10,230 bytes. The host driver will schedule transactions to read the data, which the application can read when the transfer is complete.

In USB Complete Fifth Ed, see the section, "More about time-critical transfers," page 87 in the print book.

amir

  • Member
  • ***
  • Posts: 3
Re: reach to maximum speed of USB with LPC1768
« Reply #2 on: March 06, 2016, 03:48:27 am »
I really thankful for your response...

why you say "Transferring > 64 bytes/ms isn't possible using a full-speed interrupt endpoint"?... we can send 64 bytes or less by interrupt endpoint and each frame can be 1ms so it's possible... I reach this speed (but honestly 63 bytes between 1 and 2 ms)

about your suggestions  using Bulk and Isochronous endpoint, unfortunately I don't know which changes is needed in Keil examples to reach my purpose...

I tried to increase sending bytes in my device (in Keil USBHID example that use Interrupt transfer) but the driver in PC side couldn't recognize the device... I don't know what's the problem...

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: reach to maximum speed of USB with LPC1768
« Reply #3 on: March 06, 2016, 11:02:22 am »
Yes, 64 bytes/ms is the maximum for full-speed interrupt endpoints.

To edit the Keil code, you will likely need to have a good understanding of how the original code works. If you have specific questions, we can try to help. Or try the Keil forum:

http://www.keil.com/forum/

Another option is to connect an FT232H or similar to an asynchronous serial port on your device. You can then use .NET's SerialPort class to read data from the device. On the device, you write data to the serial port. You don't need to know anything about USB.


amir

  • Member
  • ***
  • Posts: 3
Re: reach to maximum speed of USB with LPC1768
« Reply #4 on: March 07, 2016, 02:06:09 am »
thanks a lot...

Yes we can use serial port with FT232 and I did it first...but it has limitation for speed... I reach maximum 10 bytes/ms use it (read by visual studio C#)...

I need a really good document for isochronous and bulk transfer to can write my code in Keil and reach the best performance of USB (1023 bytes/ms).... and after that which driver is better for me...I use libusbdotnet library to connect with libusb-win32 driver... I don't Know is it good idea or it's better I use Winusb driver?... or maybe it's better to use other libraries?....
 
again thank's a lot... I really thankful for your replies...

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: reach to maximum speed of USB with LPC1768
« Reply #5 on: March 07, 2016, 09:38:38 am »
The limitation you were seeing was not with the FT232 chip. For any device or class:

Be sure your firmware isn't NAKing IN token packets when it could be sending data.

At the host, use a large read buffer to read in as much data as is available on each read operation.

The best document for understanding your chip's USB hardware is the data sheet and any application guide or notes from the chip provider.