|
|
|
| USB is edging out other I/O optionsThe Universal Serial Bus is making great strides at displacing other avenues to interfacing to personal computers. It is a time division multiplexed, bit serial bus capable of running at different speeds in order to support peripherals of varying performance levels. It can be expanded to connect larger numbers of peripherals through use of external expansion hubs. The connectors are made with the power pins longer than the data pins so that peripherals are "hot plug-able". When a new peripheral is connected, the USB controller detects the addition and queries the new device for its vendor ID and product ID. The controller then notifies the operating system which, in turn, loads the appropriate drivers. USB is substantially more complex than older I/O options such as the serial and parallel ports. It is not possible to simply write code to directly touch USB I/O ports or control registers. Kernel level drivers are required. Fortunately, Windows includes generic drivers for HIDs (human interface devices) such as keyboards, mice and joysticks. Also, a newer BIOS will include basic support of USB mice and keyboards to allow system boot up. Non-generic devices require their own drivers. Option: Use a converterFortunately, it's possible to make use of USB without knowing the details of USB's internal workings. Simply use a USB to game port adapter. These converters were intended to allow old style joysticks to be used on PCs having only USB connections. The converter has a standard 15 pin game port connection that you can directly wire your pots and switches to. Converters are available under the Radio Shack and Rockfire trade names (and others, no doubt). Costs are in the US$20~$50 range. The converters come with USB drivers. Option: Hack an existing USB deviceAnother approach is to buy a USB device with the sorts of inputs you need (pots & switches) and use the electronics out of it. This may seem a bit wasteful, but it provides the functionality of USB, plus comes with its own driver. Compared with the cost and effort of building from scratch, this is a very viable approach when not too many inputs are needed. In particular, take a look at USB gamepads. While early gamepads were little more than button boxes, some of the more current models have two analog joysticks. Option: DIYAs the number of inputs/outputs grow the option of developing your own USB interface starts to look attractive. Available USB chips make this quite doable. one option is the FT8U245 chip from FTDI which supports USB v1.1 and comes with drivers that make the device look like an additional COM port. Programming becomes a much more pedestrian task. For more involved applications FTDI also provides a DLL with greater functionality. Another DIY option is available from Leo Bodnar. He sells a preprogrammed chip that appears to Windows as an HID class joy stick. It has eight analog inputs, 32 buttons and a hat switch. Take a look at the USBee development products. They offer two versions of a small USB interface board; one for full speed and the second for high speed. Microchip, makers of the ubiquitous PICmicro micro controllers has also gotten in on the act with the PIC16C745/765, as well as some new stuff. You should also checkout GigaTechnology, a firm based in Australia that sells some nice board level USB interfacing products. USB ResourcesYou can learn more about USB and USB interfacing from the two part article, "USB Made Simple" by Eddy Insam in the February and March 2002 issues of Electronics World. Also see "16 Bit I/O Via USB", by Colin Attenborough in the April 2002 issue, and "Wide digital I/O from the USB port" in the November 2002 issue. Beyond Logic has on-line USB articles as well as links to other informational sites. USB Complete, now in its 3rd edition, by Jan Axelson is definitely worth a look. See her website for details. The Microchip web site has a few items for your perusal. Go to the technical document section and check out technical briefs TB054 through TB058, the first of which is appropriately titled "An Introduction to USB Descriptors". The Cypress Semiconductor site is also a wealth on USB info: lots of tech notes and sample code. And of course, don't forget Circuit Cellar. The February 2003 issue has an article about a project based on the FTDI chip for talking to a parallel port device. The August 2003 issue has an article describing a USB to CAN bus bridge, and a second overview article on USB connectivity.
|
|
It's possible that I'm not as smart as I think I am. (Occasionally, I have moments when I know this to be true. Fortunately the feeling passes quickly.) Although I have tried to make this information as accurate as I can, it is not only possible, but also quite likely, that errors lurk within. I cannot and do not warrant these pages to be error free and correct. Further I accept no liability for the use of this information (or misinformation). If, after reading this, you are still interested, please be aware that the contents of this site are protected by copyright (copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008 by John M. Powell). Nonetheless, you may copy this material subject to these three conditions: (1) the copyright notice is copied and presented along with the material, (2) the copy is used for non-commercial purposes, and (3) the source of the material is properly credited. And of course, you may link to this page. |