-
USB Polling rate
Hello,
We are using a DirectIn input device of empirisoft, with Delphi 2006 and Matlab 2006b software for our experiments.
As we learned lately, USB devices are polled by MS-Windows at 125 Hz rate (every 8 MSec).
Is there a way to eliminate this 8 MSec timing uncertainty in measuring reasponse time ? (We are interested in 1 MSec resolution).
Sincerely,
Erez Ofek
IIPDM
University of Haifa,
Israel
-
Hi Erez,
Just curious - how did you learn about the 125 Hz polling rate?
Our USB equipment uses special firmware which requests a status poll from the computer once per millisecond.
John
-
[LEFT][I][edited formatting by moderator][/I]
Hi John,[/LEFT]
[LEFT]Thank you for your reply.[/LEFT]
[LEFT]One of our researchers recently got a review of his research, which mentioned the problem of using a standard keyboard for measuring response time. When we looked for this issue in the internet, we encountered a post by Mario Kleiner, who is one of the developers of the Psychophysics Toolbox for Matlab.[/LEFT]
[LEFT]In the post he discusses the 8 msec period of the windows polling :
[URL]http://tech.groups.yahoo.com/group/psychtoolbox/message/9006[/URL]
I'm a software person, so please pardon my ignorance.
But aren't the request of USB device from the host computer, handled by the host and its operating system? If they are - how can you impose windows to serve the device every 1 msec? This issue is important to us because we need to know if we can use the empirisoft Direct-In with softwares like Matlab+ Psychophysics Toolbox and with Delphi.[/LEFT]
[LEFT]Thanks in advance,
Erez Ofek
IIPDM[/LEFT]
-
Hi Erez,
Thanks for the link.
Each USB device contains a a set of something called 'descriptors' in its firmware. These descriptors tell the host computer what sort of device is attached (a camera, a memory stick, a mouse, etc), what format the transmitted data will take, and how frequently the device needs to transmit data to the host computer.
One subset of these descriptors is a request for polling rate. As I mentioned earlier, our firmware requests a 1 mS 'tick' on this rate.
It's quite easy to confirm this with an oscilloscope. Probing either of the two USB data lines will show that they're idle except for bursts of activity 100 or 125 times per second. Since most people don't type nearly so quickly - 100 characters per second! - a 100 Hz polling interval is more than adequate.
Running the same test on our keyboards and button boxes shows communication occurring once per millisecond.