Click here if you are stuck in someone else's frames.
Analog Joysticks' Hardware

For sake of simplicity, we'll use the schematic symbols for a resistor that varies its resistance (called a variable resistor or potentiometer).  It looks like this.

On a PC system, the variable resistor of the joystick, or joystick pot, is wired in series with a capacitor.  The voltage value dropped by the capacitor is converted to a logic binary level (0 or 1), inverted, and sent to the computer.  When the voltage is low across the capacitor, the inverter sends a logic 1 (high signal) to the computer.  As the voltage increases across the capacitor, the inverter eventually changes the signal to a logic 0 (low signal) after a certain period of time has passed.

Schematic symbols provided by the P-Spice Optimizer

The high / low values of all four joystick pots (X - Y axes of 2 joysticks) and the status of all four joystick buttons (2 buttons per stick) are sent to the computer via port 201h.  The bits of port 201h are made up in the following fashion.

Port 201h
Joystick Buttons Joystick Pots
7 6 5 4 3 2 1 0

Joystick A:
Bit 0 - Joystick pot (X-axis)
Bit 1 - Joystick pot (Y-axis)

Bit 4 - Button 1's status*
Bit 5 - Button 2's status*

Joystick B:
Bit 2 - Joystick pot (X-axis)
Bit 3 - Joystick pot (Y-axis)

Bit 6 - Button 1's status*
Bit 7 - Button 2's status*

* Status is low if button is pressed, high if not.

Previous Page | Main Page | Next page

Send your questions, comments, or ideas here.