Blog Archives

More on response hardware: parallel port and USB.

I received a couple of e-mails this week from the inimitable, the mighty, the intrepid Prof. Chris Rorden, related to one of my earlier posts about parallel port response boxes. This pleased me greatly a) because he sent me a butt-load of really great information and links that I hadn’t been aware of, and b) because it’s exactly the kind of interaction with researchers that I was hoping that this blog would initiate.

Anyway, he pointed out a lot of new information. First of all, the paper that I cited from 2007 was essentially a re-tread of an older paper from 1992 which also has some nice circuit diagrams in, as well as some useful Turbo Pascal code (does anyone use Turbo Pascal anymore? I guess someone must…). He also directed me to this page which has a lot of information and circuit diagrams for experimental control of a PC.

Another hint he passed on was that on some computers the D0-D7 pins on the parallel port are not bidirectional – so may not work well for some applications, but the C0-C3 pins apparently always work for this kind of application (bottom right in the diagram below).

Parallel port pin diagram showing the three registers (data, status and control) and the ground pins (in green)

Regarding using USB input – he pointed me to this fascinating paper (PDF here) which has some theoretical analyses related to the relationship between true and measured RT, with limited resolution clocks. The surprising conclusion is that even with a clock with only a 30ms resolution, the effect on measured RT is negligible. This means that the 125Hz/8ms default USB-polling rate might not be such a big problem after all. Of course one should still be very careful about using ‘standard’ USB devices (i.e. keyboards, mice) for response timing as they can introduce significant errors as well.

Most interestingly, he pointed me towards a really sexy little device board from a company called U-HID.

The U-HID board – takes an input and transforms it into any kind of ‘standard’ computer input (key press, mouse-click, game-pad button – whatever!). Awesome.

What this does, in Chris’ words is:

“This allows 8 digital inputs to be read through the USB port. What is great is that it comes with software that allows you to assign any input to any keyboard or mouse button. The included software allows you to flash these changes to the device, so afterwards any computer will see the mappings you assigned. By default, this has a pretty good polling rate of 5ms.”

So, you can attach any kind of switch or input on one end, and when that switch is closed, the computer will see it as a key-press, a mouse-click, or whatever else you assign to it. The ‘Nano’ version of the board is really tiny, and is available from this site for only $35! This looks to be an incredibly useful bit of kit, and is probably the best solution I’ve seen for hooking up arbitrary devices to a USB input – really cool. Chris mentioned that he uses these boards for collecting responses in experiments, and also for reading the optical triggers from a Siemens Trio MRI scanner with his EZlog software (described here).

So – fantastically useful information – many thanks Chris! I’m a fan of keeping things simple, and parallel port inputs for collecting reaction times are certainly a good and easy solution; unfortunately parallel ports are largely obsolete these days, and most new computers don’t have them. The cards are still available for desktops, but in a few years these simple in-out ports may be completely unavailable. We’ll all have to move to USB devices at some point, and the U-HID boards are definitely the best-looking (and cheapest!) solution I’ve seen. I am definitely going to order a couple to try out.

Anyone else have any experience with the U-HID boards? Let me know in the comments. TTFN.

TTL-Technology – Getting Things Talking to Each Other

A common issue in psychology research is getting various bits of hardware linked up in the right way. To take a simple example, I mentioned in this post that you can build a simple response box for your experiments, but (deliberately) neglected to mention what happens with the signals from the response box at the computer’s end. How does the computer ‘know’ that your participant has pressed one of the keys? The answer is TTL (Transistor-Transistor-Logic) signals. TTL signalling was invented back in 1961, and intended as a standard way for a piece of electronic equipment to send bipolar logical signals (i.e. 1=on and 0=off) to another piece of equipment. Long before ethernet, the internet or TCP/IP, this was how computers communicated with each other. TTL-type signals can be presented through most computer’s parallel and serial ports. Read the rest of this entry