Troubleshooting, Maintaining & Repairing PCs
Stephen Bigelow
 $54.95  0-07-913732-6
Backward Forward
Chapter: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53

Reserve your copy at a
Beta Bookstore near you!
Contact Bet@books
© 1998 The McGraw-Hill Companies, Inc. All rights reserved.
Any use of this Beta Book is subject to the rules stated in the Terms of Use.

CHAPTER 24

Joysticks and game ports

Few peripheral devices have come to represent PC entertainment like the joystick (Fig. 24-1). Although it is one of the simplest peripherals available for a PC, the joystick allows a user to bring an element of hand-eye coordination to interactive programs (i.e. flight simulators and 3D "walk through" games) that would simply be impossible with a keyboard or mouse. The joystick interfaces to the host PC through a board called the game port adapter (or simply the game port). This chapter discusses the joystick and game port, then covers a selection of service issues.

Understanding the game port system

The typical game port uses a relatively simple interface to the PC. Only the lower 8 data bits are used (which explains why so many game ports still use the older 8-bit "XT" card style rather than switching to a 16-bit "AT" card type). Also, only the lower 10 address bits are needed. Since the game port is an I/O device, the card uses I/OR and I/OR control signals. On virtually all PCs, port 201h is reserved for the game port. Figure 24-2 illustrates a typical game port system.

Inside the joystick

Each analog joystick is assembled with two separate potentiometers (typically 100kW ) arranged perpendicularly to one another - one potentiometer represents the X axis, while the other potentiometer represents the Y axis. Both potentiometers are linked together mechanically and attached to a movable stick. As the stick is moved left or right, one potentiometer is moved. As the stick moves up or down, the other potentiometer is moved. Of course, the stick can be moved in both the X and Y axis simultaneously, with the proportions of resistance reflecting the stick's position. You can see the wiring scheme for a standard 15-pin dual joystick port in Fig. 24-3. The pinout for a standard joystick port is listed in Table 24-1.

Detecting the stick's X and Y position is not an intuitively obvious process. Ultimately, the analog value of each potentiometer must be converted to a digital value which is read by the application software. This is an important wrinkle - since the game port does not generate an interrupt, it is up to the particular application to interrogate the joystick port regularly. You might imagine that such a conversion would use an analog-to-digital converter (ADC). However, an ADC provides much greater resolution than is needed, and its conversions require a relatively long time. Current game port conversion circuits use a multivibrator element.

Ultimately, the resistance of each potentiometer is determined indirectly by measuring amount of time required for a charged capacitor to discharge through the particular potentiometer. If a certain axis is at 0W , the multivibrator's internal capacitor will discharge in about 24.2m S, while at 100kW , the multivibrator's capacitor will discharge in about 1124m S. Since this is a relatively linear relationship, the discharge time can easily be equated to potentiometer position (an actual routine to accomplish this requires only about 16 lines of assembler code). The multivibrator technique also simplifies the circuitry needed on the game port adapter - it is really the application that is doing the work.

A joystick also has one or two buttons. As you see from Fig. 24-3, the buttons are typically open, and their closed state can be detected by reading the byte at 201h. Since the game port is capable of supporting two joysticks simultaneously (each with two buttons), the upper four bits of 201h indicate the on/off status of all four buttons.

Adapting a second joystick

While the typical game port is capable of supporting two joysticks, most joystick products only connect a single joystick. This means only "half" the game port is being utilized. You can purchase a joystick "Y-adapter" from any computer store, or construct a "Y-adapter" using the pinout in Table 24-2. You’ll need a DB-15 male connector to attach to the game port, and two DB-15 female connectors to attach to each of the two joysticks.

&& Table 24-1&&

NOTE: Some types of game port boards provide a separate 15-pin connector for each joystick. Some cut-price game port boards only provide one connector, and the circuitry for one joystick. Verify the capabilities of your game port before using or replacing a joystick "Y-adapter".

Digital joysticks (game pads)

Where an "analog" joystick uses two potentiometers to provide linear information about the joystick’s relative position, a "digital" joystick (also called a game pad) simply uses an array of switches to indicate absolute direction - usually up, down, left, right, and fire (Fig. 24-4). The game pad actually pre-dates the analog joystick a bit, and uses a 9-pin TTL interface as illustrated in the Amiga-style game pad shown in Table 24-3. Current versions of the digital joystick (such as the Gravis GamePad Pro) use a 15-pin PC game port interface. This book will not go farther with game pad control devices, but you should at least understand how they compare to analog joysticks.

NOTE: 9-pin "game pad-type" joysticks are not directly compatible with the PC analog game port, and you should not attempt to adapt a 9-pin game pad to a 15-pin PC game port without some appropriate interface circuitry. Game pads specifically marked as PC joystick compatible (using 15-pin connectors) can usually be attached to ordinary game ports without problems.

Joystick calibration

Unfortunately, the values of time versus resistance which you saw above are not the same for every system. Variations in joystick potentiometers, game port adapter circuits, and computer speed will all effect the relationship of time versus resistance value. Even variations in component temperature as the PC warms up can cause changes in resistance interpretation. This is why each application program that uses a joystick comes with a calibration routine. Calibration allows the application to measure values for center and corner positions. With this data as a base, the application can extrapolate all other joystick positions.

Joystick drift

The term drift (or rolling) is used to indicate a loss of control by the joystick. There are several possible reasons for this. As a technician, you should understand the reasons why drift occurs, and how to correct such problems. First, drift may be the result of a system conflict. Since the game port does not generate an interrupt, conflicts rarely result in system crashes or lockups, but another device feeding data to port 201h can easily upset joystick operation. If you have sound boards or multi-port I/O boards in your system equipped with game ports, be sure to disable any unused ports (check with the user instructions for individual boards to disable extra game ports).

Another possible cause of drift is due to heat. Once PCs are started up, it is natural for the power used by most components to be dissipated as heat. Unfortunately, heating tends to change the value of components. For logic circuits, this is typically not a problem, but for analog circuits, the consequences can be much more pronounced. As heat changes the values of a multivibrator circuit, timing (and thus positional values) will shift. As the circuit warms up, an error creeps into the joystick. Well-designed game port adapters will use high-quality, low-drift components that minimize the effects of heat-related drift. It is interesting to note that the joystick itself is rarely the cause of drift. If you can compensate for drift by periodically re-calibrating the joystick, try a better-quality game port adapter board.

Finally, the quality of calibration is only as good as the calibration routine itself. A poor or inaccurate routine will tend to calibrate the joystick incorrectly. Try another application. If another application can calibrate and use the joystick properly, you should suspect a bug in the particular application. Try contacting the application manufacturer to find if there is a patch or fix available.

Cleaning joysticks

Ordinarily, the typical joystick should not require routine cleaning or maintenance. Most joysticks use reasonably reliable potentiometers which should last for the life of the joystick. The two major enemies of a joystick are wear and dust. Wear occurs during normal use as potentiometer sliders move across the resistive surface - it can't be avoided. Over time, wear will effect the contact resistance values of both potentiometers. Uneven wear will result in uneven performance. When this becomes noticeable, it is time to buy a new joystick.

Dust presents another problem. The open aperture at the top of a joystick is an invitation for dust and other debris. Since dust is conductive, it can adversely effect potentiometer values and interfere with slider contacts. If the joystick seems to produce a jumpy or non-linear response to the application, it might be worth trying to clean the joystick rather than scrapping it. Turn off the computer and disconnect the joystick. Open the joystick which is usually held together by two screws in the bottom housing. Remove the bottom housing and locate the two potentiometers. Most potentiometers have small openings somewhere around their circumference. Dust out the joystick area with compressed air, and spray a small quantity of good-quality electrical contact cleaner into each potentiometer. Move the potentiometer through its complete range of motion a few times, and allow several minutes for the cleaner to dry. Re-assemble the housing and try the joystick again. If problems persist, replace the joystick.

Joysticks and Windows 95

Games have traditionally been a domain of DOS, so there has been little support for joysticks under Windows. However, now that games are routinely using Windows 95 (taking advantage of features like DirectX, and Direct3D), you can now install and calibrate a variety of joysticks under Windows 95. Open your Control Panel and look for the Joystick icon. If a joystick icon appears in your Control Panel, joystick support is already installed, and you can skip to the Game Controller Setup. If you have not yet added your PC game port as "New Hardware" in the Windows 95 Control Panel, you should do this first:

  1. Click the Start button.
  2. Select Settings, then Control Panel.
  3. In the Control Panel, look for a Joystick icon. If it's there, skip to the Game Controller Setup. If not, double-click the Add New Hardware icon to start the Add New Hardware wizard.
  4. When prompted to have Windows search for new hardware, select NO. Click Next to continue.
  5. Select Sound, Video and Game Controllers then click Next.
  6. Select the Manufacturer and Game Port Joystick (or other appropriate Model). This will add the game port as a device. Click Next.
  7. If resource settings are given as 0201-0201, click Next. Windows will look for the required files - if it can't find these files, it will ask you to insert your Windows 95 CD or disk.
  8. When the files have been installed, click Finished.
  9. Shut down your computer and restart Windows 95 to enable your game port support.

Once your game port driver has been added, a joystick icon appears in your Control Panel. Use this to set up and calibrate your joystick:

  1. Double-click the Joystick icon in the Control Panel.
  2. In the Joystick Configuration section, choose the appropriate joystick type from the list.
  3. After selecting your Joystick configuration, click the "Calibration" button and carefully follow the onscreen instructions.

You should not be able to use the joystick under any Windows 95 game or other joystick-aware application.

Troubleshooting joysticks and game ports

The unique advantage to troubleshooting this area of a PC is that there is surprisingly little to actually go wrong. In virtually all cases, problems reside in either the joystick, the game port adapter, or the application software. This part of the chapter provides you with some handy troubleshooting issues, and examines a suite of perplexing joystick problems.

Companion CD: You can use the CALJOY22.ZIP and JOY2.EXE programs on the Companion CD to aid you with testing and calibrating joysticks.

Joystick eliminator plug

From time to time, you may find yourself testing a game port, but have no joystick handy (or it might be too much of a hassle to "borrow" a joystick already connected to a working PC). You can construct a very simple circuit with two resistors (Fig. 24-5) which can "fool" the game port into thinking that a real joystick is attached. This "joystick eliminator" plug simply places the cursor in a far corner of the display.

Adapting IDC connectors

Some multi-I/O boards implement the game port as a 16-pin IDC (ribbon cable) connector - assuming that you’ll use a DB-15 connector "plate" in another open card slot, and simply connect the DB-15 "plate" to the multi-I/O card using a 16-pin ribbon cable. The pin assignments are all identical (pin 16 of the IDC connector is just left unused), but remember that the pin order is different between IDC and DB-style connectors. For example, the top row of a DB-15 connector runs pins 9 through 15, but the top row of an IDC cable uses pins 2, 4, 5, 6, 10, 12, 14, and 16.

Sound cards and "Y-adapter" problems

You will probably encounter difficulties when connecting commercial joystick "Y-adapters" to the game port on a sound board. This is because many sound card manufacturers (such as Creative Labs) have replaced pins 12 (ground for joystick 2 switches 3&4) and 15 (N.C. or +5V) with specialized MIDI interface pins. The problem doesn’t surface using a single joystick because pins 12 and 15 are normally unused. But when a second joystick is added through a "Y-adapter", the second joystick will probably fail to function. Table 24-4 illustrates a simple correction to enable a commercial "Y-adapter". Essentially, you must disconnect pins 12 and 15 at the game port (sound board) end, then cross-wire pin 12 to pin 5 (ground), and cross-wire pin 15 to pin 9 (+5V). If you want to make your own sound-board compatible "Y-adapter", follow the pinout in Table 24-5.

NOTE: Do NOT attempt to connect a MIDI device to the sound card while this modified "Y-adapter" is in place. Doing so can easily DAMAGE the MIDI device or the sound card’s MIDI/game port.

Symptom 24-1. The joystick does not respond. Make sure that the joystick is plugged into the game port correctly. When the game port has more than one connector, be sure that the joystick is plugged into the correct connector (joystick 1 or joystick 2). If the game port is running through a sound board, make sure that the sound board is configured to use the port as a game port instead of a MIDI port, and see that any joystick "Y-adapter" is wired properly. Refer to the application and see that it is configured to run from the joystick (if mouse or keyboard control is selected, the joystick will not function). Now that many new joysticks are appearing with supplemental functions (i.e. hat switches, throttle controls, and so on), make sure that the application is written to take advantage of the particular joystick. If problems persist, make sure that the game port is set for the proper I/O address (most are fixed at 210h, but check the user documentation to be sure). Try a known-good joystick with the game port. If a known-good joystick works, the original joystick is defective and should be replaced. If another joystick is not the problem, try a different game port board.

Symptom 24-2. Joystick performance is erratic or choppy. Start by checking the joystick to be sure that it is connected properly. Try another joystick. When a new joystick works properly, the original joystick is probably damaged and should be replaced. If a new joystick fails to solve the problem, the game port board may be too slow for the system. Remember that many game ports still use XT board types. An older board design may not be able to process joystick signals fast enough to provide adequate signaling to the system. Not only should you try another game port adapter, but you should use a speed-adjusting game port.

Symptom 24-3. The joystick is sending incorrect information to the system - the joystick appears to be drifting. First, check the application to be sure that the joystick is calibrated correctly. If you cannot calibrate the joystick, the application may not support the joystick properly - try another application. Make sure that there are no other active devices in the system (such as other game ports) using I/O port 201h. If this happens, data produced on those other boards will adversely effect the game port you are using. If all unused game ports are disabled, check the active game port. Poor-quality game ports can drift. Try a newer, low-drift or speed-adjusting game port board.

Symptom 24-4. The basic X/Y, two-button features of the joystick work, but the hat switch, throttle controls, and supplemental buttons do not seem to respond. In virtually all cases, the joystick is configured wrong. Check the application first - many new applications provide several different joystick options, and even allow you to define the particular use of each feature from within the application itself.

Check the joystick definition files next. Your joystick probably requires a supplemental definition file (i.e. an .FCS file) in order to use all of the joystick’s particular features. Finally, check the game port type. You may need a "dual-port" game port adapter rather than an inexpensive "single-port" game port adapter. Some enhanced joysticks use BOTH joystick positions (i.e. the XY axis and fire buttons make up one joystick, while the throttle and other buttons take up the other position). You may need to install a dual-port game port card.

Symptom 24-5. You see an error such as; "Joystick Not Connected" under Windows 95. Windows 95 does not recognize the game port hardware. Check the game port driver first. Use the Device Manager under Windows 95 to examine the resources assigned to the game port driver. Typically, the resource range should be set to 201h through 201h (only one address location). If the game port entry has a yellow icon next to it, there is a hardware conflict in the system, and other hardware is also trying to use the same I/O location.

Next, check the game port hardware for proper configuration. The game port card should be installed properly into its bus slot. Make sure that the game port is enabled (this is typical of game ports integrated onto sound cards or multi-I/O cards). If a sound card enables you to switch a 15-pin port between MIDI and joystick, see that the jumper is set to the "joystick" position. Make sure the joystick cable is not cut or damaged anywhere, and see that it is attached securely to the game port. Finally, test a known-good joystick on the system. If a new joystick works as expected, the original joystick is probably suffering from internal wiring damage.

Symptom 24-6. The joystick drifts frequently and requires recalibration. This type of symptom is usually the result of problems with the game port adapter. Try a different game port adapter and see if the problem persists. If problems disappear, you simply need a better-quality or speed adjusting game port. Otherwise, test a known-good joystick on the system. If a new joystick works as expected, the original joystick is probably suffering from internal wiring damage, and should be replaced.

Symptom 24-7. The joystick handle has lost tension - it no longer "snaps" back to the center. This problem may be accompanied by a rattling sound within the joystick. In most cases, a spring has popped out of place inside the joystick. Check the joystick for internal damage. Open the joystick and see if any springs or clips have slipped out of place. Replace any springs or clips (if possible). Some joysticks also employ mechanical latches which can enable or disable the "spring action" of the X and Y axis. Check to see that any such latches are enabled. If you cannot locate or correct the problem, simply replace the joystick outright.

Symptom 24-8. The joystick responds, but refuses to accept a calibration. In virtually all cases, the problem is with your game port adapter. Check the hardware setup - make sure that there are no other devices in the system using the I/O address assigned to your game port (i.e. 201h). If more than one adapter in your system has game port capability, see that only one game port is enabled. Replace the game port, or enable a different game port in the system. If drift issues continue with different applications, you may need to replace the game port adapter with a "low drift" or speed adjusting model.

Symptom 24-9. The hat switch and buttons on a joystick work only intermittently (if at all). This problem also applies to stand-alone pedals. In most cases, erratic behavior of a joystick’s "enhanced features" is a symptom of game port speed problems. Check the joystick first. Try a known-good joystick. If the problems disappear, the original joystick may in fact be defective. If the problems persist, you have a game port problem. Make sure that there are no other devices in the system using the I/O address assigned to your game port (i.e. 201h). If more than one adapter in your system has game port capability, see that only one game port is enabled. If drift issues continue with different applications, you may need to replace the game port adapter with a "low drift" or speed adjusting model.

Symptom 24-10. When downloading FCS (or calibration) files to a joystick, the line saying; "put switch into calibrate" doesn’t change when the download switch is moved. This is a typical problem with advanced joysticks. In most cases, the joystick needs to be "cleared". Clear the joystick - rock the download switch back to "analog", then to "calibrate" - this should clear the joystick for a new calibration download. Try downloading the FCS file again. If problems persist, the actual switch may be defective. Try a known-good joystick instead.

Symptom 24-11. To download a calibration file, you need to rock the red switch back and forth a number of times (or hit the <Enter> key a number of times) to get it to 100%. This is virtually always the result of a keyboard controller (keyboard BIOS) compatibility problem. Upgrade the keyboard controller (keyboard BIOS). Some advanced joystick products do not interact well with the host computer’s keyboard controller. For example, Thrustmaster’s Mark II experiences known microcode problems with a few of keyboard controller chips on the market. These include AMI versions (D, B, 8, 0), Acer, and Phoenix. You may need to replace the keyboard controller with a later version.

Symptom 24-12. You cannot use a joystick to a PC using a sound card with an ESS or OPTi chipset. The joystick may stop responding while using an application, or report a "not connected" status the Game Controllers area of the Control Panel. This is a known problem with the ESS and OPTi sound chipsets. You’ll need to set "Single Mode DMA" to use the joystick:

  1. Click Start, select Settings, and then click Control Panel.
  2. Double-click Multimedia.
  3. On the Advanced tab, double-click the Audio Devices entry to expand it.
  4. Click the "Audio for..." entry that corresponds to your particular sound card, then click Properties.
  5. Click Settings.
  6. Click the "Use Single Mode DMA" check box to select it.
  7. Click OK until you return to Windows, then restart the PC.

Symptom 24-13. The joystick port is not removed when the sound card is removed. The entry for your game port will still be visible in the Windows 95 Device Manager. This is not really a problem - Windows 95 does not recognize the game port as being part of the sound card, so removing the sound card doesn’t automatically disable the game port. Also, the virtual joystick device driver (Vjoyd.vxd) cannot detect whether the game port or joystick are installed or not, so the driver is always active. You’ll need to manually remove the game port in Device Manager:

  1. Use the right mouse button to click My Computer, then click Properties on the menu.
  2. Click the Device Manager tab.
  3. Double-click the "Sound, Video, And Game Controllers" entry to expand it.
  4. Click the joystick port, then click Remove.
  5. Return to Windows 95 and restart the system.

Symptom 24-14. You cannot disable a "jumperless" joystick port. This is an issue that frequently crops up with newer sound boards like the Ensoniq VIVO, and jumperless boards are controlled exclusively through drivers. The VIVO also uses drivers to disable certain functions like the joystick port. Use the following steps to disable the VIVO’s joystick port (the specific command lines for your own sound board may be different, but idea is very similar):

  1. Leave Windows 95 and enter the MS-DOS mode.
  2. Edit the SNDSCAPE.INI file in the \Windows directory. Change the line JSEnable=true to JSEnable=false (check your particular sound board’s documentation for the correct command line).
  3. Save the file and reboot the system. The joystick will now be disabled.

Further study

That’s all for Chapter 24. Be sure to review the glossary and chapter questions on the accompanying CD. If you have access to the Internet, take a look at some of the joystick and gameport resources listed below:

Advanced Gravis: http://www.gravis.com

Logitech: http://www.logitech.com

Thrustmaster: http://www.thrustmaster.com

CH Products: http://www.chproducts.com/

Backward Forward
Chapter: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53

Reserve your copy at a
Beta Bookstore near you!
Contact Bet@books
© 1998 The McGraw-Hill Companies, Inc. All rights reserved.
Any use of this Beta Book is subject to the rules stated in the Terms of Use.

Beta Books | Beta Bookstores | Computing McGraw-Hill

Professional Publishing Home | Contact Us | Customer Service | For Authors | International Offices | New Book Alert | Search Catalog/Order | Site Map | What's New


A Division of the McGraw-Hill Companies
Copyright © 1998 The McGraw-Hill Companies. All rights reserved. Any use is subject to the Terms of Use; the corporation also has a comprehensive Privacy Policy governing information we may collect from our customers.