POKEY has eight analog to digital converter ports most commonly used for potentiometers, also known as Paddle Controllers. The analog inputs are also used for the Touch Tablet controller, and the 12-button, video game Keyboard Controllers. Each input has a drop transistor, which can be set on or off from software. The timers can also be used to support a
light pen, by connecting a
photodiode to the drop transistor, which captures the timer when the electron beam in the television passes by the pen. The vertical position of the pen had to be read separately.
POT0 $D200 Read SHADOW: PADDL0 $0270 Paddle Controller 0 Input
POT1 $D201 Read SHADOW: PADDL1 $0271 Paddle Controller 1 Input
POT2 $D202 Read SHADOW: PADDL2 $0272 Paddle Controller 2 Input
POT3 $D203 Read SHADOW: PADDL3 $0273 Paddle Controller 3 Input
POT4 $D204 Read SHADOW: PADDL4 $02704 Paddle Controller 4 Input
POT5 $D205 Read SHADOW: PADDL5 $0275 Paddle Controller 5 Input
POT6 $D206 Read SHADOW: PADDL6 $0276 Paddle Controller 6 Input
POT7 $D207 Read SHADOW: PADDL7 $0277 Paddle Controller 7 Input Each input has 8-bit timer, counting time when each TV line is being displayed. This had the added advantage of allowing the value read out to be fed directly into screen coordinates of objects being driven by the paddles. The Atari Paddle values range from 0 to 228, though the maximum possible is 244. The Paddle controller reads 0 when turned to its maximum clockwise position, and returns increasing values as it is turned counter-clockwise ending at its maximum value. The Paddle reading process begins by writing to
POTGO which resets the POT* values to 0, the
ALLPOT value to $FF, and discharges the potentiometer read capacitors. The POT* values increment as they are being scanned until reaching the resistance value of the potentiometer. When the Paddle reading is complete the corresponding bit in
ALLPOT is reset to 0. The Paddle scanning process can take the majority of a video frame to complete. The Atari Operating System takes care of Paddle reading automatically. The Paddles are read and paddle scanning initiated during the stage 2 vertical blank. Paddle values are copied to shadow registers. (Note that Paddle triggers are actually joystick direction input read from PIA.) A faster mode of scanning the Paddles is possible by setting a bit in
SKCTL. The reading sequence completes in only a couple scan lines, but the value is less accurate.
ALLPOT $D208 Read Potentiometer Scanning Status Each bit corresponds to one potentiometer input (the POT* registers). When paddle scanning is started by writing to
POTGO each paddle's bit in ALLPOT is set to 1. When a paddle's scan is complete the corresponding bit in ALLPOT is reset to 0 indicating the value in the associated POT* register is now valid to read.
POTGO $D20B Write Start Potentiometer Scan Writing to POTGO initiates the potentiometer (Paddle) scanning process. This resets the POT* values to 0, the
ALLPOT value to $FF, and discharges the potentiometer read capacitors. As each potentiometer scan completes the bit corresponding to the potentiometer in
ALLPOT is cleared indicating the value of the associated POT* register is valid for reading. ==Serial input output port==