ATARI KEY PAD
NOTE: We mentioned last month that you could get one of these 12 button pads, which are similar in profile to the TS2068, for 50¢ at local Odd-Lot stores (as part of the Star Raiders package for the ATARI 2600 or VCS). Experimentation has since shown that pin 8 is not connected. This pin is the STB line on the 2068’s left and right joysticks and is the essential line required by STICK. As such, the pad cannot be used directly with a 2068. Modifications to the 2068 and/or replacement of the pad cord are required if you intend to use the pad. Further, unless you’re willing to do some sophisticated rerouting and I/O software development, it is unlikely that more than 10 of the buttons can be effectively used. We’ll be publishing a detailed “Hackers Notebook” item on this unit next month. At 50¢ we still think the STAR RAIDERS package is a good source for experimenters parts.
HACKERS NOTEBOOK – ATARI KEY PAD (STAR RAIDERS)
The attached page one gives the schematic for the ATARI Key pad and 2068 joystick (a fairly standard joystick configuration). Note that line 8, STB is the one key pin missing from the key pads plug. This makes the pad useless as a simple input device. Still, there are several inexpensive ways around this problem. Some of these will be illustrated here and others, requireing somewhat more advanced skills, will be suggested.
A glance at page 1 of 2 shows that the standard ATARI or TS 2068 joystick uses 5 data lines and one strobe to send data into the computer. The strobe line on some machines is simply ground or +5V on many machines, the important thing to remember is that it is the “common” connector. Crossing any one of the 5 data lines (up, down, left, right, Fire) with the common, or strobe, line pulls that line low (on our machines, STB is an active low line). The Input/Output (I/O) port in the 2068 reads the 5 data lines and latches the bit pattern of D0 D1 D2 D3 (directions) and D7 (fire) into the Programmable Sound Generator (PSG) chip. The STICK command reads the I/O ports in the chip, manipulate the data slightly, and returns a value (2,4,8 or 12 for the 4 compass points) to the BASIC for your program to use. STB is actually a different line on each joystick. The left is A8 (address line #8), the right, A9.
STICK is thus a sophisticated IN routine. Compare the use of STICK and IN in the attached joystick test program. If you type this in, you’ll find that STICK is somewhat faster. This is because the IN lines must each be interpreted by BASIC, one at a time. STICK does the equivalent of several functions at once. The trade-off for this sophistication is a loss of speed, as you’ve seen, and flexibility. IN reads all 5 data lines and report the results as a single Byte (e.g., 128=FIRE, 129=FIRE & UP)
Since STB isn’t connected on the ATARI key pad, we need some other way to read which switches are closed. A look through the 2068 tech manual tells us that all the data lines are latched high on start up. When resister 14 of the PSG is read (for STICK, or certain IN addresses) the appropriate STB line is brought low. If the joystick is activated, a data line contact is made with STB, and the appropriate data (DN) line is brought low. The ROM software reads this and passes a parameter to BASIC, which is then used by your program.
We can make a data line go low just as easily by grounding it. Again, however, there are trade-offs and problems. By using ground we’ve lost our ability to tell which (left or right) joystick is responding. (E.g., if A8 is low and the right fire button is pushed a normal STICK command will not read it). Still, if we only need to monitor one joystick (5 data inputs), this will suffice. We tried this and nothing happened.
It appears that in most 2068’s, the joystick port ground line is not connected. In order to use the ATARI key pad, we had to connect the ground line on our joystick port. This is a fairly simple procedure, involving soldering a short piece of wire from pin 9 to a nearby ground. For the left joystick, the negative side of the nearby Electrolytic capacitor works fine. Be very careful when soldering to the joyports legs, however. These are two unconnected pins in the inner row of four, you want the one closest to the front of the machine. We found it easier to remove the whole circuit board to do this job, as you must work around the outer row of 5 pin. Be careful not to short any lines together.
The ATARI pad, as can be seen from page 1 of 2, uses a 3 X 4 (3 columns by 4 rows) matrix to read the twelve touch pads. Our simple ground = STB setup gives us a potential 1 X 5 array. If we don’t modify the circuit traces of the key pad (see pg. 2 of 2), the least we can do is read the 4 row inputs in one column or the 3 columns for 1 row. The later is practical for many platform games; where left, right and jump are the only moves required. Page 2 of 2 shows how the internal clip-on lugs of the ATARI keypad were changed in order for us to read row 3’s 3 buttons as left, fire and right (reading from L to R). Depending on the software, this setup should work with commerical programs which use one joystick, as well as it does in our BASIC test program. The new configuration of the port, of course, ignores whatever the software is trying to do with A8 and A9 and simply reads that the data line is grounded. We’ve lost port selection and some more esoteric features like software debounce, but these may not be a problem in your application Note that this modified pad will only work on a port with pin 9 grounded. Do not try to use the modified pad on an ATARI or Spectrum joystick interface. At best, it will not respond, at worst it could short out the machine. Finally note that the keypad has 2 – 4700 Ω pullup (down ?) resistors crossing two of the column lines. One end of each of these must be unsoldered or cut. The keypad modifications are shown on page 2 of 2.
ADVANCED TOPICS
Since there are two X 5 lines, or 10 data lines, on the PSG, it is possible to rewire the 2068 and keypad to scan 10 of the buttons. This would provide a handy numeric keypad (using STICK), for the digits Ø then 9. We need, of course to hook up strobe and this where the incomplete wiring of the 2068 may actually help us. On the left joystick port We connected ground where it should be to use a single row of the keypad. We could modify the right side port, which is use less frequently. to read all 5 data lines on either joystick.
This can be accomplished as follows: (not tested)
Connect a jumper from A8 on the left port to pin 5 of the right port. Connect a jumper from A9 on the right port to pin 9 on the right port. This should not effect operation of a normal 6 wire joystick (U,D,L,R, Fire and ground wire only-check the plug). It does, however, provide both the A8 and A9 Strobes to pins which the ATARI key pad can read. You must also modify the foil pattern of the key pad circuit board to match a 2 X 5 matrix. This involves cutting some traces and adding a few jumpers. Write interrupt drivers software, following the example in the tech manual) which scans your new key pad automatically. Spray paint the pad silver if you have a 2068, and add bigger rubber feet to match the 2068’s slope and you’ve got a sophisticated “dedicated numeric keypad”.
There are other ways to make this unit more useable with your 2068 and other computers and we’ll take a look at those next month.

Engineering Chart Sheets – Sheet No. 1 of 2
ATARI PAD JOYSTICK PLUG
PLUG PIN (TYP)
2068
R1 BR 1 U D3
R2 Rd 2 D D2
R3 OR 3 L D1
R4 YL 4 R D0
C1 GN 5 N/C -
C3 BU 6 FI D7
+ VI 7 - +5 ?
N/C N/C 8 S̅T̅B̅ S̅T̅B̅
C2 Wh 9 - NOTE(1) ⏚ ?
TABLE 2.[illegible].[illegible]-1
JOYSTICK CONNECTOR SIGNAL ASSIGNMENT
P/N | SIGNAL NAME | I/O PORT BIT | FUNCTION
----+-------------+--------------+---------------------
1 | D̅I̅R̅1̅ | 0 | STICK UP
2 | D̅I̅R̅2̅ | 1 | STICK DOWN
3 | D̅I̅R̅3̅ | 2 | STICK LEFT
4 | D̅I̅R̅4̅ | 3 | STICK RIGHT
5 | --- | ---- | not used
6 | B̅U̅T̅T̅O̅N̅ | 7 | PUSH BUTTON
7 | 5V | --- | 5 VOLT POWER
8 | R̅E̅A̅D̅ ̅S̅T̅R̅O̅B̅E̅ | --- | ADDRESS BIT 8 OR 9*
9 | GND | --- | POWER GROUND
----+-------------+--------------+---------------------
*When Address bit 8 is high the READ strobe to the left joystick is
driven low When address Bit 9 is high the READ strobe to the right
joystick is driven low
Bit 7 6 5 4 3 2 1 0
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ └─ STICK UP
│ │ │ │ │ │ │
│ │ │ │ │ │ └─ STICK DOWN
│ │ │ │ │ │
│ │ │ │ │ └─ STICK LEFT
│ │ │ │ │
│ │ │ │ └─ STICK RIGHT
│ │ │ │
│ └───┴───┴─ NOT USED (Always [illegible])
│
└─ BUTTON DEPRESSED

NOTES:
1) Power &/or Ground may not be connected on your machine. Grounding in particular may not be connected.
2) The absence of a connection on pin 8 of the ATARI touch pad makes it unsuitable for use with the TS 2068 joystick ports (or as a joystick, per se, for any ATARI compatible).
3) Removal of pullup resistors is probably required.
Engineering Chart Sheets – Sheet No. 2 of 2
ATARI TOUCH PAD – MODIFICATION #1 LEFT/RIGHT & FIRE (JUMP)
USE LEFT JOYPORT ON TS2068
10 FOR i=1 TO 700
20 PRINT STICK (1,1);
30 NEXT i
89 STOP
90 FOR i=1 TO 700
100 OUT 245,14
110 LET a=255-IN 246
120 PRINT a;
130 NEXT i
200 OUT 245,14: OUT 246,255
299 STOP
300 FOR i=1 TO 200
310 IF STICK (1,1)=4 THEN PRINT "Left"
320 IF STICK (1,1)=8 THEN PRINT TAB 20;"Right"
330 IF STICK (2,1)=1 THEN PRINT TAB 10;"FIRE"
360 NEXT i
Lines 10-30: NORMAL STICK – PAD WILL GIVE 4=L; 8=R
Lines 90-130: INPUT FIRE=128; 4=L; 8=R
PAD WILL PRINT LEFT, RIGHT OR FIRE FOR BOTTOM ROW.
NOTE: YOU MUST CONNECT GROUND TO PIN #9 INSIDE THE 2068

Transcription note: The hand-written pin table and the pasted manual table disagree on which data bit is which direction. Both are as printed.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

