[time-nuts] USB fun and games

Manfred Bartz vk3aes at gmail.com
Fri Jul 17 04:34:45 UTC 2020


>  If I plug a thumb drive into a connector, I get a different USB hub than
I get
>  when I plug a GPS mouse into the same connector.

I assume you are using MS-Windows.
Maybe have a look with a USB tree viewer.
https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/usbview
The 2 devices you mention belong to different device classes and utilize
different parts of the USB driver stack.  Maybe that has something to do
with it?

If you look at the MS-Win USB architecture, you'll find that there is a
low-level USB driver stack which interacts with the PC's USB root hubs.
The drivers for the various USB device classes and all custom USB drivers
are "client drivers" which do not have control over the  low-level USB
driver stack.
Therefore even writing your own "client driver" will not improve Window's
determinism.
https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-3-0-driver-stack-architecture

> I tried it in a newer system.  That polls at 125 microseconds.
> Well, most of the time. Every 5 min (rough) it gets another 125
microseconds
> added to the timing.

That should not be surprising because it is typical behaviour when 2
different clock domains exchange data.
The USB link and it's timing is firmly under host control while the USB
device has its own, independent clock.
And USB host timing granularity is 125uS at best.




On Fri, Jul 17, 2020 at 11:40 AM Hal Murray <hmurray at megapathdsl.net> wrote:

>
> After all my noise about the FT232R polling at 125 microseconds, I thought
> I
> would see if I could make a hanging bridge.  To my surprise and annoyance,
> it
> was polling at 1ms.
>
> I screwed around for a while but couldn't get it to work on the hardware
> and
> kernel that it was plugged into.
>
> I think there is a magic mux between the USB hardware/firmware on the host
> and
> the wires to the connectors.  If I plug a thumb drive into a connector, I
> get
> a different USB hub than I get when I plug a GPS mouse into the same
> connector.
>
> After a while, I tried it in a newer system.  That polls at 125
> microseconds.
> Well, most of the time. Every 5 min (rough) it gets another 125
> microseconds
> added to the timing.
>
> Here are a couple of graphs.
>
> http://users.megapathdsl.net/~hmurray/time-nuts/USB/USB-125usec-a.png
> http://users.megapathdsl.net/~hmurray/time-nuts/USB/USB-125usec-b.png
>
> Does anybody know anything about this quirk?
>
> Initially, I had another GPS gizmo plugged into that box.  Now there there
> are
> no other USB devices.
>
> Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
> Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 001 Device 004: ID 0403:6001 Future Technology Devices International,
> Ltd
> FT232 Serial (UART) IC
> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
>
>
>
> --
> These are my opinions.  I hate spam.
>
>
>
>
> _______________________________________________
> time-nuts mailing list -- time-nuts at lists.febo.com
> To unsubscribe, go to
> http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
> and follow the instructions there.
>


-- 
--
Manfred
VK3AES



More information about the Time-nuts_lists.febo.com mailing list