I am trying to check what is the maximum speed for
read/writes of my pic 18f4550 usb device.
It is a full speed device and an
8 byte length report, and I am using ReadFile and
WriteFile. My results are that I get about 100 read
write cycles in one second. Is that a normal speed
for 8 byte reports? It seems quite slow ? My C loop
is tight, and my device is a loopback device, i.e. it simply
copies the input to the output?

Re: How long does it take to read a usb report? by Maxim

Maxim
Mon Jun 19 13:49:34 CDT 2006

IIRC the USB spec contained the table of theoretical speed limits for each
packet size.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

<Stephani Deltufo> wrote in message
news:eoHF2yykGHA.4200@TK2MSFTNGP05.phx.gbl...
> I am trying to check what is the maximum speed for
> read/writes of my pic 18f4550 usb device.
> It is a full speed device and an
> 8 byte length report, and I am using ReadFile and
> WriteFile. My results are that I get about 100 read
> write cycles in one second. Is that a normal speed
> for 8 byte reports? It seems quite slow ? My C loop
> is tight, and my device is a loopback device, i.e. it simply
> copies the input to the output?
>
>


Re: How long does it take to read a usb report? by Stephani

Stephani
Mon Jun 19 14:01:42 CDT 2006


> IIRC the USB spec contained the table of theoretical speed limits for
each
> packet size.

Ah yes, but I am not looking for that, I am looking for packets per seconds
and not bits/second, do you see the difference?



Re: How long does it take to read a usb report? by Marc

Marc
Mon Jun 19 17:45:14 CDT 2006

OK, so you are writing 8 Bytes to the OUT port of the USB device, copying
the 8 Bytes to the IN port, and reading that in.

Are you using blocking write/read, overlapped, separate handles or separate
thread?

The fastest that the write will occur will be the following frame from the
one in which you make the request at the user level, so you will have a
delay of 1-2mSec. You will probably not be able to copy the data from the
write fast enough to fullfill a pending read, if you had one pending, so
that would be another 1 mSec. You would probably not get it back to the
user level for another millisecond.

So, you are probably looking at a round trip of 4 milliseconds minimum (250
Hz) for a write/readback pair.

Similar results for a read/writeback pair

If this is a HID device, then it will also depend on the polling rate set by
the device.

Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics

<Stephani Deltufo> wrote in message
news:OUSGyL9kGHA.1260@TK2MSFTNGP05.phx.gbl...
>
>> IIRC the USB spec contained the table of theoretical speed limits for
> each
>> packet size.
>
> Ah yes, but I am not looking for that, I am looking for packets per
> seconds
> and not bits/second, do you see the difference?
>
>



Re: How long does it take to read a usb report? by Tim

Tim
Mon Jun 19 23:26:10 CDT 2006

<Stephani Deltufo> wrote:
>
>I am trying to check what is the maximum speed for
>read/writes of my pic 18f4550 usb device.
>It is a full speed device and an
>8 byte length report, and I am using ReadFile and
>WriteFile. My results are that I get about 100 read
>write cycles in one second. Is that a normal speed
>for 8 byte reports? It seems quite slow ? My C loop
>is tight, and my device is a loopback device, i.e. it simply
>copies the input to the output?

If you need more performance, try using OVERLAPPED mode, and queue up the
ReadFile before you do the WriteFile. That way, you're ready for it as
soon as it comes back.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.