Wednesday, December 16, 2015

Analog Controllers in Consoles and Computers

A digital joystick is just four contact switches activated by pressing a directional instead of a button.  This includes the Intellivision's controller, which has sixteen discrete positions, and most console "joysticks".  An analog control allows for smoother movement instead of relying solely on the amount of time a directional has been pressed.  Originally, analog knobs or paddles were used with Pong and other ball and paddle games. Eventually the combination of two of these "paddles" with a common control became a joystick and achieved some popularity for racing and flight simulators.  Outside these pigeonholes, most of the popular games of the 70s and 80s used digital joysticks, trackballs and rotary spinners (the latter are used in the Breakout-derived Arkanoid).  Only in the mid-90s with the rise of first and third person 3D games did a compelling need for a general analog controller present itself.  In the blog post, I will discuss how analog controllers used to be used and how they are used today.

True analog controllers in the video game world use variable resistors.  The humble variable resistor, also called a potentiometer, has had a wide variety of applications.  You will see them at work in light switches, to change volume or temperature.  They were often used in video game controllers.

There are two ways in which analog control was implemented at the hardware level, and both involve potentiometers.  The most common way is to use the potentiometer as a variable resistor in a resistor/capacitor discharge network.  In this method, a capacitor is discharged then a port is read until the capacitor indicated it was recharged.  The time it took for the capacitor to charge gave the position of the potentiometer.  More resistance equals a longer charging time.  Only two wires are connected to the potentiometer in this case, one of the end terminals (to +5v) and the middle terminal is connected to the console.

The second method is to use the potentiometer as a voltage divider with a comparator.  In this method, the potentiometer's output voltage is compared to a voltage ramp, which is reset, and the time it takes for the voltages to become equal indicates the stick's position.  In this case, all three terminals of the potentiometer, one end to +5v, one end to GND and the middle terminal gives the signal to the console or computer.

Atari 2600 & 7800

The Atari 2600 usually came with a pair of paddle controllers.  Each paddle had a potentiometer connected to two terminals, making it function like a variable resistor.  Each controller port could support a pair of paddles but only one of any other type of controller.  Paddle games were the only official solution for four-player gaming.  The output line of these potentiometers is connected to the TIA chip.  The rating of these potentiometers is 1MOhm.  Each paddle had a single button, which shared the same line as the left or right joystick directional.  Button inputs are connected to the 6532 RIOT chip.

Interestingly, while not an analog controller the Keypad Controllers and their clones also make use of the potentiometer lines.  There are insufficient digital inputs on the 2600 controller port to read a 4x3 matrix.  What the 2600 does is to set the joystick inputs as outputs and send a signal through each of the four lines.  These correspond to each horizontal row of keypad keys.  One column is read via the joystick fire button input on the TIA and the other two columns are read through one of the paddle input lines with the assistance of a 4.7KOhm resistor.

The Atari 7800 is backwards compatible with the Atari 2600 and includes a TIA and 6532, but no 7800 games support analog controllers.

Apple II

The Apple II and II+ came with a 16-pin socket which could accept four paddle inputs.  These systems came with a pair of paddles with the Apple logo branded on them.  Like the Atari paddles, these operate as variable resistors.  They use 150KOhm potentiometers.   Soon someone figured out that you can pair two paddle inputs to make a joystick input.  Unfortunately, there were only three button inputs, making the use of two joysticks rare.  Typically a single joystick would only use the first two button inputs.

The Apple IIe kept the joystick socket but also added an external DE-9 port containing the lines necessary to support the four analog inputs and three digital inputs.  This port uses the same lines at the 16-pin socket, but it is easier to plug in and remove peripherals from the external port than the internal socket.  The Apple IIc removed the internal socket and required the joystick to share the port with a mouse, limiting the joystick to two analog and digital inputs.  For the IIe and IIc Apple released a joystick and paddles separately that use the DE-9 connector.  The Apple IIgs has the capabilities and connectors of the IIe but also supports a fourth digital input for four buttons.

Tandy Color Computer, IBM PC & Tandy 1000

The IBM PC uses a DA-15 gameport supporting four axes and four buttons.  The Tandy Color Computer and 1000 uses a pair of DIN-6 connectors, each supporting two axes and two buttons.  All of these computers use 100KOhm potentiometers, but the IBM standard wires them as variable resistors and the Tandy machines wire them as voltage dividers.  Like the Apple II, these interfaces use discrete circuitry instead of a custom chip.

Tandy's regular CoCo joystick uses one button and are non-self centering.  They are not regarded highly.  The Tandy Deluxe Joystick is self-centering, has two buttons and can be set to free-floating mode.  The IBM PCjr. joystick has the same features and look identical to the Tandy Deluxe Joystick, but has a different connector and is wired as a variable resistor.  Both joysticks hail from Kraft-designed joysticks, which were pretty much the standard for the early to mid 80s for the Apple II and IBM/Tandy.

See here for more discussion of issues relating to the IBM PC joystick :

The Apple II usually runs at one speed and unless an accelerator is being used, the constant speed eliminates issues with reading from the joystick port.

Commodore VIC-20 & Commodore 64

The VIC-20 has one joystick port, so only one pair of paddles is supported.  The paddles are connected to the 6560 VIC chip, which provides video and audio.  Because the paddles are wired to the Atari standard, the buttons are handled by one of the 6522 VIA chips.

The C64 has two joystick ports, so two pairs of paddles are supported.  The paddles are connected to the 6581 SID chip, which also handles the audio for the computer.  The SID chip only has two analog potentiometer inputs, so the inputs from two pairs of paddles are multiplexed and read with the assistance of one of the 6526 CIA chips.  The CIA chip also handles button reading.

Commodore's paddles can be used with either system and they use a resistance value of 470KOhms.  Atari 2600 paddles are more common and usually work OK, indicating that Commodore's paddles are wired as variable resistors.

Atari 8-bit Computers and 5200

The Atari 400 and 800 computers could support four pairs of paddles using its four controller ports.  These are connected to the POKEY chip inside the system, which has eight analog input pins.   Super Breakout for the Atari 8-bit computers supports eight paddles used in a sequential fashion.  POKEY is also used for audio generation and other system functions including scanning the keyboard for pressed keys. The buttons are read by the 6520 PIA chip.  The 2600 paddles are used in these computers.

The Atari 5200 was noted for being the first system to come with an analog joystick.  The Atari 5200's joysticks manipulates a pair of potentiometers (not smaller than those found in paddles) and use a resistance value of 500KOhms.  The 4-port system could, as its name implies, support for of these joysticks.  The 2-port system could only support two joysticks.  No paddles were specifically made for the 5200.  There is no PIA chip in the 5200, so the joystick buttons are read by the GTIA chip.  The keypad buttons are read similarly to the keyboard keys in the 8-bit machines by the POKEY, but multiplexers are used.

The later Atari 8-bit machines, from the 1200XL, 600XL, 800XL, 65XE, 130XE and XE Game System eliminate two of the controller ports, so you can only use two pairs of paddles with these machines.


The Vectrex controller may not have had quite as many buttons as the 5200 controller, but four independent fire buttons was a rarity.  Its joystick was smaller than the 5200's and apparently less brittle.  Also, far more importantly, the joystick is self-centering.  The innards of the joystick look very similar to those of the Sony Dual Shocks to come in the following decade.

Not only does the Vectrex controllers contain a pair of potentiometers attached directly to the joystick, but there are also a separate pair of trimmer potentiometers located elsewhere on the PCB.  Apparently these can be adjusted without opening the joystick and serve to fine tune the joystick's centering, not too dissimilar to how Apple and PC joysticks work.  These trimmer potentimeters are 10KOhms.

Unlike the Tandy sticks, which have one end terminal of the potentiometer connected to +5v and the other end terminal connected to GND, the Vectrex stick has one end terminal connected to +5v and the other end terminal connected to -5v.  The resistance value for these potentiometers also appears to be 10KOhms.

Because Vectrex controllers are rare and only two commercial Vectex games use the analog function, Sega Genesis 3-button controllers have been converted to work with them.

NES & Famicom

NES Controllers are primarily digital, they send out a bit for a pressed button.  However, the NES and Famicom versions of Arkanoid were released with a paddle controller.  This controller, called the VAUS Controller in the US, could be used instead of the gamepad.  The Famicom controller plugged into the expansion port and the NES controller plugged into Controller Port 2.  The paddle had one button.  The NES and Famicom controllers are not compatible with each other, they function identically but use different bits to send their data.  No other NES game used its Arkanoid controller, but the Famicom games Chase HQ and Arkanoid 2 could use the Famicom Arkanoid controller.  The NES controller has a small screw that could be used to adjust the sensitivity of the controller via a trimpot.  The Famicom controller does not have a trimpot.

The interior of the Arkanoid controller shows a 556 timer and potentiometer wired only to two terminals.  This means that it works just like in the Apple II or IBM PC.

Thumbsticks - Sony PlayStation Dual Shock controllers and their successors

Outside the classic consoles, most systems of the third and fourth generation of video games did not support analog controllers.  In the fifth generation, things began to change.  The Nintendo 64 was released with an "analog" thumbstick, but the thumbstick uses optical sensors and is not really an analog controller for the purposes of this article.

The basic principle of how the analog thumbsticks operate on a PlayStation Dual Shock controller is similar to how the Tandy CoCo joysticks work.  Although its successors may offer more analog controls, the basic functionality is unchanged.  Essentially each thumbstick manipulates a pair of potentiomers, one for each axis of the stick.  These potentiometers are wired in the three pin style, making them voltage dividers.  When the stick is in the neutral position, the sticks should be outputting half the maximum voltage (2.5V).  The controller chip of the controller reads these values and converts them into a digital 8-bit value which is sent with other stick and button information as a multi-byte serial packet to the console.

I have read that using a voltage divider is more precise than using a resistor/capacitor network as used in PCs and Atari consoles and computers.  However, potentiometers are notoriously loose with their tolerances (20% seems to be the norm).  I imagine Sony and its competitors may have higher quality parts and the lower resistance ranges (0-40KOhms seems to be about right) and the shorter travel distances may tighten the tolerance a bit (10% seems reasonable)

Every PlayStation game that supports the thumbsticks should use a standard routine to calibrate the thumbsticks when the game is bootup.  Even with tighter tolerances and more compact form factors, the dead center position may not reflect the midpoint voltage reading.

No comments:

Post a Comment