Silicon ChipUSB: Hassle-Free Connections To Your PC - November 1999 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: DC power in the home; it could be made to work
  4. Feature: USB: Hassle-Free Connections To Your PC by Peter Smith
  5. Project: A Speed Alarm For Cars; Pt.1 by John Clarke
  6. Book Store
  7. Serviceman's Log: Price isn't everything by The TV Serviceman
  8. Project: Multi-Colour LED Christmas Tree by Les Grant
  9. Feature: Electric Lighting; Pt.15 by Julian Edgar
  10. Product Showcase
  11. Feature: Setting Up An Email Server by Peter Smith
  12. Project: Build An Intercom Station Expander by Paul Hoad
  13. Vintage Radio: The case of the disappearing TV sets by Rodney Champness
  14. Project: Foldback Loudspeaker System For Musicians by John Clarke
  15. Project: Railpower Model Train Controller; Pt.2 by John Clarke & Leo Simpson
  16. Order Form
  17. Notes & Errata
  18. Market Centre
  19. Advertising Index
  20. Outer Back Cover

This is only a preview of the November 1999 issue of Silicon Chip.

You can view 34 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "A Speed Alarm For Cars; Pt.1":
  • PIC16F84(A)-04/P programmed for the Speed Alarm for Cars [SPEED254.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC16F84 firmware and source code for the Speed Alarm for Cars [SPEED254.HEX] (Software, Free)
  • Speed Alarm for Cars PCB patterns (PDF download) [05310991/2] (Free)
  • Speed Alarm for Cars panel artwork (PDF download) (Free)
Articles in this series:
  • A Speed Alarm For Cars; Pt.1 (November 1999)
  • A Speed Alarm For Cars; Pt.1 (November 1999)
  • Speed Alarm For Cars, Pt.2 (December 1999)
  • Speed Alarm For Cars, Pt.2 (December 1999)
Articles in this series:
  • Understanding Electric Lighting; Pt.1 (November 1997)
  • Understanding Electric Lighting; Pt.1 (November 1997)
  • Understanding Electric Lighting; Pt.2 (December 1997)
  • Understanding Electric Lighting; Pt.2 (December 1997)
  • Understanding Electric Lighting; Pt.3 (January 1998)
  • Understanding Electric Lighting; Pt.3 (January 1998)
  • Understanding Electric Lighting; Pt.4 (February 1998)
  • Understanding Electric Lighting; Pt.4 (February 1998)
  • Understanding Electric Lighting; Pt.5 (March 1998)
  • Understanding Electric Lighting; Pt.5 (March 1998)
  • Understanding Electric Lighting; Pt.6 (April 1998)
  • Understanding Electric Lighting; Pt.6 (April 1998)
  • Understanding Electric Lighting; Pt.7 (June 1998)
  • Understanding Electric Lighting; Pt.7 (June 1998)
  • Understanding Electric Lighting; Pt.8 (July 1998)
  • Understanding Electric Lighting; Pt.8 (July 1998)
  • Electric Lighting; Pt.9 (November 1998)
  • Electric Lighting; Pt.9 (November 1998)
  • Electric Lighting; Pt.10 (January 1999)
  • Electric Lighting; Pt.10 (January 1999)
  • Electric Lighting; Pt.11 (February 1999)
  • Electric Lighting; Pt.11 (February 1999)
  • Electric Lighting; Pt.12 (March 1999)
  • Electric Lighting; Pt.12 (March 1999)
  • Electric Lighting; Pt.13 (April 1999)
  • Electric Lighting; Pt.13 (April 1999)
  • Electric Lighting, Pt.14 (August 1999)
  • Electric Lighting, Pt.14 (August 1999)
  • Electric Lighting; Pt.15 (November 1999)
  • Electric Lighting; Pt.15 (November 1999)
  • Electric Lighting; Pt.16 (December 1999)
  • Electric Lighting; Pt.16 (December 1999)
Items relevant to "Railpower Model Train Controller; Pt.2":
  • Railpower PCB pattern (PDF download) [09308991] (Free)
  • Railpower panel artwork (PDF download) (Free)
Articles in this series:
  • Build The Railpower; Pt.1 (October 1999)
  • Build The Railpower; Pt.1 (October 1999)
  • Railpower Model Train Controller; Pt.2 (November 1999)
  • Railpower Model Train Controller; Pt.2 (November 1999)
  • Railpower Model Train Controller; Pt.3 (December 1999)
  • Railpower Model Train Controller; Pt.3 (December 1999)

Purchase a printed copy of this issue for $10.00.

Connecting a new device to your PC can be a real hassle. But imagine being able to add peripherals without opening the case, adding interface cards or even having to switch the PC off or reboot it. Those are just some of the advantages offered by USB. By PETER SMITH M OST OF US at one time or another have struggled with the software or hardware configuration when installing new peripherals on personal computers. The Plug and Play (PnP) standard introduced with Windows 95 helped PC HOST CONTROLLER & ROOT HUB USB PORTS to ease the pain a little but what do you do when that scanner, printer and Zip drive just won’t work together on the same parallel port? The answer is USB! USB is an acronym for Universal Serial Bus. Developed over the last few years by a group of industry leaders including Intel, Microsoft, Compaq and NEC, USB has finally opened the way for stress-free peripheral connection. The key goal for the USB designers was to create an expansion bus that would make adding peripherals as easy as plugging a connector into a socket. A multitude of USB-ready devices are already available, including scanners, cameras, Zip drives, modems, keyboards, mice, ethernet (network) adapters and joysticks. So let’s have a MONITOR & 2-PORT HUB KEYBOARD & 2-PORT HUB UPSTREAM PORT 4-PORT HUB SPEAKERS MOUSE JOYSTICK DOWNSTREAM PORTS The USB ports on this computer are located on the rear panel, just below the two PS/2 ports. 4  Silicon Chip Fig.1: most modern PCs come with two USB ports and many USB peripherals include inbuilt hubs so that other devices can easily be added to the bus. Alternatively, you can use a dedicated hub to add extra ports. CLIENT SOFTWARE USB DRIVER SOFTWARE HOST CONTROLLER DRIVER SCOPE OF OHCI/UHCI SPECIFICATION HOST CONTROLLER HARDWARE USB DEVICE Fig.2: the OHCI and UHCI standards affect the host controller hardware and its software driver. Motherboards that use Intel chipsets are UHCI compliant while many add-on controllers are OHCI compliant – see text. look at some of the advantages of this new system and how it all fits together. USB basics Adding a new device to your PC in the past usually meant opening up the case, installing an interface card and worrying about such things as IRQs and I/O addresses, etc. That no longer applies with USB – you just plug the device into a USB connector and it works. Up to 127 devices can be connected to the USB bus – more than most of us will ever need. Connections to the bus can be made without switching off the power (known as “hot-plugging”), making it possible to add peripherals and to move them between machines with a minimum of fuss. USB has two bus speeds to optimise efficiency: (1) a “low-speed” mode that operates at 1.5 megabits per second (1.5Mb/s); and (2) a “full-speed” mode that operates at 12 megabits per second (12Mb/s). The low-speed mode is intended for interactive peripherals such as game pads and mice, whereas the full-speed mode provides lots of throughput for printers, scanners and video cameras, etc. High-speed devices like fast disk drives and fast (100Mb/s) networking controllers are not suitable for use with USB. Table 1 compares the fullspeed USB transfer rate with the rates of other interfaces. As can be seen, it’s a lot faster than a standard serial or parallel port. The majority of IBM-compatible PCs designed from 1998 onwards have The USB standard has two connectors: (1) an upstream Series “A” connector as shown at right and (2) a downstream Series “B” connector as shown at left. The different connector styles make it impossible (at least, in theory) to connect two downstream ports or two upstream ports together. USB ports as standard equipment. But that doesn’t mean that you can’t have USB if your PC is older than this. Many older machines can easily be upgraded to support USB but more on that later. Adding ports Most PCs provide only two USB ports but expansion is a simple matter of adding a low-cost hub. USB hubs provide one port for connection to the PC side of the bus (called the upstream port) and typically between four and seven output ports for connecting peripherals or even another hub (these are called downstream ports) – see Fig.1. Some peripherals also come with hubs built in, allowing devices to be daisy-chained. Both the signal and power connections are provided by a single USB cable, eliminating the need for separate power sources for low power peripherals. Devices that draw power directly from the bus are said to be “bus-powered”, whereas devices that have their own power source are called “self-powered”. Self-powered hubs (and this includes the “root” hub that is part of the USB host controller in the PC) can supply a maximum current of 500mA per port. On the other hand, bus-powered hubs can supply only 100mA per port, so this is something to look out for when selecting a hub or a peripheral with an embedded hub. As a matter of interest, power distribution on the bus is under software control and this ensures that the bus is not inadvertently overloaded. USB connectors Because simplicity is an important part of the design, only two types of connectors exist in USB: (1) Series “A” and (2) Series “B”. The Series “A” type is used for all upstream connections (ie, towards the host PC), while the Series “B” connectors are used for the downstream connections (towards peripherals and hubs). Small devices usually have a captive (moulded in) cable with a Series “A” plug on the end. Larger devices, such as monitors, printers and hubs, usually have removable cables, with a Series “A” plug on one end and a Series “B” plug on the other. These are commonly referred to as “A-B” cables. November 1999  5 USB Peripherals From Namlea Data Systems  A self-powered 4-port USB hub: an upstream port (not visible) connects to the PC while the four downstream ports are for the peripherals. (Namlea Data Systems, phone (02) 9429 0800; www.ndsonline.com.au).  The idea behind the different connector types is to prevent accidental “bus loop-back”, by making it impossible to connect two downstream or two upstream ports together (eg, on two different hubs). We should mention here that although it is physically possible to connect two computers together using a non-standard USB cable (ie, with a Series “A” connector on both ends), the results could be catastrophic! To perform this function, go shopping for a USB bridge – it performs the necessary magic and protects your motherboard from possible damage. Typically, cables are available in 2, 3 and 5-metre lengths, with five metres being the maximum allowable length. It is possible to extend this distance by cascading hubs (up to five levels deep) but USB was never intended for long hauls. If you need to cover long distances but still want to use USB, consider using USB-to-Ethernet adaptors. Dual standards This bus-powered USB-Ethernet adapter with LED indicators lets you connect a PC fitted with a USB port to a network. (Namlea Data Systems).   USB to IEEE1284 parallel converter cable. (Namlea Data Systems). 6  Silicon Chip While the Universal Serial Bus itself is now a well-defined standard, two different standards were drafted for the PC interface side of the USB host controller and the software components that communicate with it. In particular, Intel developed the Universal Host Controller Interface (UHCI) standard, while other USB developers, including Microsoft, Compaq and NEC, developed the Open Host Controller Interface (OHCI). Naturally, all motherboards with Table 2: Win 95/98 Releases Version Number Windows Release 4.00.950 Windows 95 retail 4.00.950A 4.00.950C Windows 95 OSR 1 Windows 95 OSR 2.0 or 2.1 Windows 95 OSR 2.5 4.10.1998 Windows 98 4.10.2222A Windows 98 SE 4.00.950B Intel chipsets are UHCI-compliant, as are motherboards with Via Technologies chipsets. However, many add-on USB cards use hardware from other chip manufacturers (such as OPTi, Ali, CMD, National Semiconductor and RealTech) and are OHCI-compliant. A few problems have surfaced recently with a number of peripherals when connected to OHCI-compliant controllers. Windows 98 Second Edition fixes some but apparently not all of these problems. Check the list of supported USB controllers and peripherals in the Windows 98 SE hardware.txt file if you are having intermittent problems or plan to upgrade. Further information on USB support in Windows 98 can be found on the Microsoft web site at http:// support.microsoft.com Operating system support If you want to use USB peripherals on a PC, Windows 98 is the way to go. It includes full support for USB, with its Plug and Play (PnP) system A bus-powered USB to RS232 serial port converter. This could be used for connecting a modem, for example. (Namlea Data Systems). If you don't already have USB ports on your computer, a USB adapter card is the answer. This unit plugs into a spare PCI slot on your motherboard and gives you two USB output ports on the backplane connector. ($49 from Microgram Computers. Phone (02) 4389 8444; web site www.mgram.com.au). perfectly suited to the task. If you plug in a simple device like a mouse or keyboard, it is usually (but not always) immediately recognised and a generic driver automatically installed. Other more complex peripherals may also be recognised but their functions will often be limited until the manufacturer’s USB driver software (supplied with the hardware) is installed. Of course, this only needs to be done once. Unfortunately, Windows 95 provides only partial support and as far as we know, no future updates will be made available to extend this support. Some USB peripheral manufacturers have even dropped support for Windows 95 altogether, so if you’re running Windows 95 and don’t want to upgrade just yet, check out the operating system requirements before you buy USB peripherals. What about Windows NT4? Unfortunately, NT doesn’t have true Plug and Play support and so is unsuitable for USB. On the other hand, IBM provides limited support for USB in their OS/2 Warp 4 operating system. However, you will need to obtain the OS/2 USB Basic driver from IBM’s web site (see Table 3). For Mac users, Apple provides USB support with their Power Mac G4, iBook and iMac systems, with many peripheral drivers pre-loaded. If you have a Mac, check to ensure that the operating system offers full USB support. Finally, USB stacks are now appearing for various flavours of Linux and FreeBSD. Adding USB to your PC By now, some readers will be wondering whether their PC has USB support or not. Alternatively, they may just wish to check that the USB function is working correctly before adding their first USB peripheral. So what are the basic hardware and software requirements for USB? We’ll discuss the requirements below and describe some of the potential pitfalls as they relate to IBM-PC compatible systems running Windows 95/98. Motherboard manufacturers began integrating USB controllers into their first generation Pentium designs. Unfortunately, not all early Pentium motherboards have USB controllers built-in but if you have a free PCI slot, you can purchase an add-on USB controller card that will do the job. These are now widely available and retail for around $40. In addition, PC assemblers do not always install the necessary USB port connectors. If you think that your motherboard has an inbuilt USB controller but there are no external connectors, check the system docuNovember 1999  7 Fig.3: this entry in System Properties (Device Manager tab) is for an Intel UHCI-compliant USB controller. Fig.4: this dialog box is similar to Fig.3 but shows the entry for an OHCI-compliant USB controller. Fig.5: this dialog box lets you check the hardware version of your PCI-to-USB host controller. mentation for details or give the supplier a call. Suitable brackets with port connectors and cables that plug into the motherboard are available but note that the motherboard connector styles can vary between manufacturers. Many first generation Pentium mother­boards utilise the Intel 82371­ SB PCI-to-USB host controller. However, the first revision of this controller may not work reliably in some applications, as standards development was still under way when this chipset was designed. To check if your machine is affected, right-click on the My Computer icon on the desktop and select Properties. Click on the Device Manager tab and expand the Universal Serial Bus controller device – see Fig.3. If an 82371SB PCI-to-USB host controller is listed, double-click on that line to display its properties – see Fig.5. On the General tab, look for the “Hardware version” line. If the version is “000”, then you may have difficulties. Later versions are OK. Motherboards that incorporate Via Technologies VT82C586B or VT82C­596 PCI-to-USB host controllers need a software patch installed to correct a number of problems. Check out the Via Technologies website (see Table 3) for details. Many Pentium II and III machines will already have all the right hardware installed but the USB controller may not be enabled in the BIOS setup. The procedure to check this varies considerably between machines (depending on the BIOS), so refer to your motherboard’s manual. In rare cases, you may also need a flash BIOS update. If you are an experienced user, you can download the latest BIOS for your motherboard from the manufacturer’s website and install it yourself. Be careful here though – if you mess things up, you will be left with a machine that won’t boot until you get the BIOS chip replaced. Depending on the age of the machine, your supplier may also be able to help with BIOS updates. Finally, if all else fails, it’s possible to disable the on-board USB controller in the BIOS setup and install an addon controller card – assuming that you have a free PCI slot. USB TV Tuner: it turns your PC into a TV set and lets you convert live video into AVI files Called the “LifeView”, this external TV tuner simply plugs into a USB port on your PC (no need to turn the power off), making it easy to “hot-swap” from one machine to the next. It supports all TV standards including PAL, NTSC and SECAM in their various formats and features external video inputs (both composite and S-video) so that you can connect a VCR. The video window can be scaled from 80 x 60 up to 640 x 480 pixels using the supplied software. In addition, live video can be captured and saved as AVI files and you can also capture and save still images. A digital camera suitable for 8  Silicon Chip Windows 98 video conferencing or video email is included with the unit, which is also TWAIN-compliant. The unit is available from Vision Beyond 2020. Phone (03) 9558 0333. As mentioned before, Windows 98 automatically detects and installs the correct drivers for most built-in USB controllers. If you’re installing an add-on USB controller card though, you’ll probably need to load the manufacturer’s driver. The appropriate instructions and software will be supplied with the card. A simple utility from Intel called USB Ready gives an indication of USB hardware and software status and is available for free download from http://www.usb.org/data/usbready. Table 3: Useful USB Websites Fig.6: the USB View utility (supplied with Windows 98) allows you to quickly check the status of the USB hardware connected to your PC. exe Yet another utility called USB View is supplied on the Windows 98 CD – look for it in the \tools\reskit\ diagnose folder. Fig.6 shows a typical output from USB View. In this case, we have a 4-port hub connected to USB Port 2 of the PC. A USB-Ethernet Adapter and a USB Com Port have then been plugged into Ports 1 & 3 of the hub. It’s also worth checking that both the USB host controller and root hub appear in System Properties. This can be found by right-clicking the My Computer icon on the desktop, selecting Properties and then clicking the Device Manager tab – see Figs.3 & 4. A red cross through either the controller or root hub obviously indicates a problem. Sometimes this can be cured by deleting the devices and restarting the machine – Windows 98 will detect the devices again and reinstall the drivers. The first release of Windows 98 apparently has a number of USBrelated problems, many of which are addressed in Service Pack 1. This pack can be down­loaded from http:// windowsupdate.microsoft.com or contact Microsoft to get a copy on CD. Windows 95 We said earlier that Windows 95 does not provide full USB support. If you’d like to give it a shot anyway, you will need to have Windows 95 OSR 2.0, 2.1 or 2.5 installed – earlier versions won’t work. You also need a UHCI-compliant USB controller, as OHCI-compliant controllers are not supported. Note that motherboards with built-in USB controllers using Intel and Via chipsets are UHCI-compliant, while addon USB controller cards are generally OHCI-compliant. You can check which version of Windows 95 you have by right-click10  Silicon Chip USB Impl ementer's Forum http://www.usb.org Intel USB techni cal http://www.intel.com/design/usb Intel USB support http://support.intel.com/support/technologi es/usb Intel chipset support http://support.intel.com/support/chipsets Microsoft Windows 98 http://www.mi crosoft.com/hwdev/busbios/usbwin98.htm Appl e http://www.appl e.com/usb Appl e Macintosh http://www.macintouch.com/imacusb.html Appl e USB Peripheral s http://guide.appl e.com/uscategories/usb.html IBM OS/2 Warp http://servi ce.software.ibm.com/os2ddpak/html /uni versa Vi a Technologi es http://www.viatech.com/dri vers CMD http://www.cmd.com/semiconductor/support/docs/670/usbpatch.cfm FreeBSD http://www.etl a.net/~n_hibma/usb/usb.pl Linux http://www.linux-usb.org Aten Technology http://www.aten-usa.com/ USB Stuff http://www.usbstuff.com USB Workshop http://www.usbworkshop.com A l l U SB http://www.allusb.com ing the My Computer icon on the desktop, then select Properties. The version number will be shown on the General tab. If USB support is already installed, it will be listed in Add/Remove Programs in Control Panel as “USB Supplement to OSR2”. Note that if the supplement has been uninstalled, the Windows version number will change from 4.00.950C to 4.00.950B! Table 2 shows the various Windows 95/98 releases. If you have Windows 95 OSR 2.5, the USB supplement files can be found on the Windows CD in the \other\updates\usb folder. Look for a file called usb.txt, which describes the installation procedure. Windows 95 OSR 2.0 and 2.1 users can download the USB supplement from the web in a single file called usbsup.exe. We couldn’t find this file on the Microsoft website but you can get it from a number of other sites – try the USB Workshop (see Table 3). You simply run usbsup.exe to perform the installation and reboot you machine when it is complete. Note that a minor problem can occur when installing the USB supplement. Windows may pause after it detects the host controller and prompt you for the location of the file uhcd.sys. All you need to do is change the path to c:\windows\system and hit OK. A further complication arises with Windows 95 and hardware support. Motherboards designed after Windows 95 was released incorporate new features that are not detected by the operating system and this includes the USB controller. A disk (or CD) may have been provided with your PC that includes the necessary drivers for Windows 95 and this should have been pre-loaded by your supplier. However, if Windows 95 has since been reinstalled from scratch using the original Microsoft CD, the drivers will also need to be reinstalled. If you don’t have these drivers and you know which chipset is used on your motherboard, you can download them from the manufacturer’s website (see Table 3). Windows 95 users can also run the USB Ready utility to verify the USB hardware and software status on their PC. What, USB 2.0 already? Readers who are already familiar with USB 1.1 may have heard about the new USB 2.0 specification. At time of writing, USB 2.0 was still in the drafting stages but we can tell you that the main difference between 1.1 and 2.0 is the speed. USB 2.0 will run at 360 megabits per second (360Mb/s) or more, while still maintaining backward compatibility with USB 1.1 peripherals. And no, that’s not a SC misprint!