A Digital JoyStick for the
IBM-PC Parallel Printer Port

Joysticks designed for use with the IBM-PC are analog devices which plug into the game port. It is possible to re-wire a digital joystick, as used with games computers such as various Atari and Commodore machines, for use via an IBM-PC compatible computer's parallel printer port.

A digital joystick works with microswitches, normally open. Pushing the joystick in a given direction and/or pressing a button closes one or more of the switches, completing one or more circuits. The stick is spring-mounted to automatically return to the centre position when released.

There are normally four switches for direction and one switch per button. Pressing any button usually produces the same signal.

 layout

(Some joysticks also have a "fire" button on the top of the stick itself)


ZIPSTIK

Here's one I made earlier

I bought a ZIPSTIK ® joystick at a boot sale for £2 and replaced the cable with one of my own design. (Since then, I have picked up a similar joystick for £1 and there are plenty more out there!)

Cable Connections

 wiring

The resistors wired to ground are required to pull the Status Register floating inputs low when the microswitches are open.

N.B. Since preparing this document, it has been pointed out (thanks, Zhahai!) that a larger resistor would probably be better -

                1K puts all the data outputs on the edge of their 
    specified range at once (assuming sourcing 2.4 mA at 2.4 V) - and 
    some of the one-chip serial/parallel/etc chips may not meet the same 
    standards as the old LS TTL ports.  I suspect that several times this 
    value would work fine while stressing the chip less.

Till says:

                                                            a 1k resistor
   is indeed a very low value for the pulldowns, a value of 10k or higher
   is sufficient.

Before starting to read the joystick, F8 Hex must be written to the Data Register to provide TTL high on the outputs. Then whenever a switch is closed the corresponding input will go high. (Note that bit S7 is inverted - i.e. TTL high on pin 11 will produce a 0 in S7 and vice versa).

Pairs of adjacent switches can be closed simultaneously, giving a total of 8 direction signals. Since there are only five inputs available on the standard IBM-PC parallel port, it makes sense to wire all the buttons up in parallel, so that pressing any or all of them returns the same signal.

Values returned for different joystick positions
    S4[N]   0   1   0   0   1   0   0   1   0
    S5[S]   0   0   1   0   0   1   0   0   1
    S6[E]   0   0   0   1   1   1   0   0   0
   ~S7[W]   0   0   0   0   0   0   1   1   1
Direction   -   N   S   E  NE  SE   W  NW  SW
    Value   0   1   2   4   5   6   8   9  10
Having both pairs of opposites (N & S, E & W) adjacent gives the smallest range of values.

Here are some versions of a program to read a digital joystick wired up as above -

Turbo PascalBorland C/C++MS-Visual C/C++MS-QBasic


So what's the point of a digital joystick for a PC when there are plenty of cheap analog ones available?

Well, apart from seeing if it would work (!), it might be useful to have simple ON/OFF input signals, particularly for controlling one or more other external devices. An example might be the Department's Robot Arm, which is normally controlled by a bank of buttons on a hand-held device or via the PC mouse with point-and-click software.


Note:
I have used a joystick wired up as above successfully on a range of IBM-PC clones, but there is no guarantee that it will work on a given PC. I found that an old Wyse286 didn't seem to allow all 5 inputs to its parallel port Status Register to be pulled low simultaneously, for instance.

I cannot be held responsible for any damage caused by following the instructions in this document.

Copyright © 1995, 96, 97 Ian Harries and Imperial College, London, UK

Other Sources of Information


[ Back to the PC Parallel Port Index ]

last updated: 20-Aug-98 Ian Harries <ih@doc.ic.ac.uk>