I am trying to synchronize the PC time to USB frame number for a device
I am developing. I am using Cypress's CYUSB device driver. It does not
provide a way to get the current USB frame number. Is there any way to
get the USB frame number without writing a driver?

Re: Can you get the USB frame number without writing a driver? by Marc

Marc
Thu Oct 13 14:16:34 CDT 2005

I don't think so, but I am curious as to the object of this endeavor?

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

<code@martinsound.com> wrote in message
news:1129202603.555407.307310@o13g2000cwo.googlegroups.com...
>I am trying to synchronize the PC time to USB frame number for a device
> I am developing. I am using Cypress's CYUSB device driver. It does not
> provide a way to get the current USB frame number. Is there any way to
> get the USB frame number without writing a driver?
>



Re: Can you get the USB frame number without writing a driver? by code

code
Fri Oct 14 08:22:23 CDT 2005

I need to synchronize the application's computational engine and many
USB devices, to a single variable speed clock. This variable speed
clock. may or may not be on the USB bus.

My current thought is to have the application phase lock to the
incoming clock. I am using the multimedia timer as its time base. I
now would like to convert this multimedia timer based locked loop to
the USB frame counter to synchronize to many devices on the USB bus.


Re: Can you get the USB frame number without writing a driver? by Marc

Marc
Fri Oct 14 19:04:17 CDT 2005

The USB devices can synchronize to the bus because they see the frame
counter. However, an application will almost certainly be off by
milliseconds from the devices due to the latencies of the system as it
services other threads, interrupts, etc.

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

<code@martinsound.com> wrote in message
news:1129296143.322353.32780@g47g2000cwa.googlegroups.com...
>I need to synchronize the application's computational engine and many
> USB devices, to a single variable speed clock. This variable speed
> clock. may or may not be on the USB bus.
>
> My current thought is to have the application phase lock to the
> incoming clock. I am using the multimedia timer as its time base. I
> now would like to convert this multimedia timer based locked loop to
> the USB frame counter to synchronize to many devices on the USB bus.
>



Re: Can you get the USB frame number without writing a driver? by code

code
Sat Oct 15 07:47:52 CDT 2005

This is a phase lock design, so the application has a whole tic of the
variable speed clock to determine what to do next. This tic is long
enough, so there are no latency problems. However there is a jitter
problem because the application has no reference to the USB clock.


Re: Can you get the USB frame number without writing a driver? by Marc

Marc
Sat Oct 15 09:26:11 CDT 2005

What are the sizes of the tick and jitter?

Marco

<code@martinsound.com> wrote in message
news:1129380472.828618.263120@g43g2000cwa.googlegroups.com...
> This is a phase lock design, so the application has a whole tic of the
> variable speed clock to determine what to do next. This tic is long
> enough, so there are no latency problems. However there is a jitter
> problem because the application has no reference to the USB clock.
>



Re: Can you get the USB frame number without writing a driver? by Tim

Tim
Sat Oct 15 13:15:27 CDT 2005

code@martinsound.com wrote:
>
>I am trying to synchronize the PC time to USB frame number for a device
>I am developing. I am using Cypress's CYUSB device driver. It does not
>provide a way to get the current USB frame number. Is there any way to
>get the USB frame number without writing a driver?

The Cypress EZUSB driver certainly provides an IOCTL to fetch the current
frame number: IOCTL_EZUSB_GET_CURRENT_FRAME_NUMBER.

Of course, there's no guarantee that you will get a response within a
millisecond.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: Can you get the USB frame number without writing a driver? by code

code
Sun Oct 16 09:02:48 CDT 2005

I am not using their old driver "EZUSB.sys", which has
IOCTL_EZUSB_GET_CURRENT_FRAME_NUMBER.

I am locked into using their current driver "CYUSB.sys", which does
not have a get frame number command.


Re: Can you get the USB frame number without writing a driver? by code

code
Sun Oct 16 09:11:41 CDT 2005

The tick is about 30 milliseconds. Currently the jitter is 2
milliseconds. If I could lock with the frame number, I should be able
to get the jitter to 1 microframe = 125 nanoseconds.


Re: Can you get the USB frame number without writing a driver? by Marc

Marc
Mon Oct 17 11:07:33 CDT 2005

Windows is not a real time OS. This is about as good as you are going to
get.

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

<code@martinsound.com> wrote in message
news:1129471901.044649.205470@g44g2000cwa.googlegroups.com...
> The tick is about 30 milliseconds. Currently the jitter is 2
> milliseconds. If I could lock with the frame number, I should be able
> to get the jitter to 1 microframe = 125 nanoseconds.
>



Re: Can you get the USB frame number without writing a driver? by code

code
Tue Oct 18 08:50:43 CDT 2005

The point is, if I can phase lock the the USB frame clock, the Windows
OS has nothing to do with the jitter. The only reason I am talking
about the Windows OS, is that I can not get the USB frame clock without
using a different driver.


Re: Can you get the USB frame number without writing a driver? by Maxim

Maxim
Tue Oct 18 18:11:56 CDT 2005

> I need to synchronize the application's computational engine and many
> USB devices, to a single variable speed clock.

USB spec has a chapter about several possible designs of such a thing. You can
try reading it and deciding what way you want.

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



Re: Can you get the USB frame number without writing a driver? by code

code
Wed Oct 19 08:47:21 CDT 2005

That chapter does not help me, since I do not what to synchronize data
transfer rates. I am trying to synchronize a clock. I am trying to send
a command to all the devices to synchronize their next operation to a
particular frame. This particular frame is in the future and is
specified as the current USB frame + N. (Where N is large enough to
eliminate OS jitter considerations.) I know how to compute N. What I
need is to phase lock to the current USB frame.

The problem still remains is how to get a fairly low latency source (
phase locking will make jitter tolerable ) for the current USB frame in
the root hubs.