uludaggonul / snow-dots

Automatically exported from code.google.com/p/snow-dots
0 stars 0 forks source link

What is the best timing to be expected from USB? #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Snow Dots wants to control external hardeware for things like firing a solenoid 
or dropping Plexon ecodes.  The most convenient output would be USB HID 
devices, such as the USB1208FS from Measurement Computing.

But is USB timing reliable enough?  What timestamps are available and how close 
to the hardware can they get?  What does the USB spec say about timing, what 
does HID say, and what about the OS X (or various Windows) implementation of 
USB control?

Can I modify and use mexHID?  Is there a timestamp that mexHID can read which 
is deterministically related to an actual hardware event?

I need to read and form an approach.

Original issue reported on code.google.com by Benjamin.Heasly on 10 Aug 2010 at 9:30

GoogleCodeExporter commented 8 years ago
I've done a bunch of reading and I'm about to write up what I found on the 
wiki...

Original comment by Benjamin.Heasly on 10 Aug 2010 at 9:31

GoogleCodeExporter commented 8 years ago
[USBTimingBreadcrumbs] contains a notes on what I learned about USB and HID, 
and the results of some timing tests.

[MCC1208FSTiming] is a work in progress, specifically about the Measurement 
Computing 1208FS device (a reasonable candidate for general use with Snow Dots).

Original comment by Benjamin.Heasly on 27 Aug 2010 at 12:14

GoogleCodeExporter commented 8 years ago
[MCC1208FSTiming] now contains test results for the digital and analog sides of 
the 1208FS device.  The digital IO is unlikely to be useful for input 
detection.  The analog IO may be useful indeed.

Original comment by Benjamin.Heasly on 14 Sep 2010 at 10:14

GoogleCodeExporter commented 8 years ago
In general:
  * The USB host uses frames to organize time.  They may be 1ms or 125us wide, either of which would be suffice.
  * But a device is not requires to communicate on every frame, so not every USB device is suitably fast.
  * mexHID can read frame numbers and times from the OS X USB host controller, so even slow, jittery bus transactions can be bound in time for analysis.
  * A device like the 1208FS, which has its own memory and can be triggered, can work outside the jitter of user code on the host side, and give a full account at some later, jittered time.

So I think USB is a reasonable option.  I've left my tests in the repository 
and my results on the wiki.  I'm closing this ticket!

Original comment by Benjamin.Heasly on 14 Sep 2010 at 10:21