Stokes’ ProjBlog

A journal documenting innumerable, mostly terminally in-progress undertakings. Nerdiness abounds.

 

Check Out my (Atari Key-)Pad, Part 3: Making it Work September 11, 2013

Filed under: The Atari Keypad Project — Stokes @ 11:13 am

Keypad HookupNote: for some reason, something in the combination of the code listings in this post, the syntax highlighter I’m using (Crayon), and my theme causes rendering problems in some browsers. I apologize if parts are difficult to read. I’m looking into it.

To recap: In part 1, I figured out how the CX85 keypad works and how it’s wired; in part 2, I made a change to the Arduino’s HID library that will give me more control over the keypad emulation. Now, to write a sketch to drive it!

Hooking the keypad up to an Arduino Leonardo was trivially easy. I used a male DB9 on a ribbon cable, the serial port from an old computer. A simple breakout board (the most complex part of the setup) just widens the 2×5 header connector enough to fit across the gap of a breadboard, DIP style. I wired it to the Arduino somewhat out of order:
(more…)

 
 

Check out my (Atari key-)Pad, Part 2: HID Hacking September 9, 2013

Filed under: The Atari Keypad Project — Stokes @ 12:05 pm

Modifying the HID APIOnce I figured out the hardware inside the Atari CX85 keypad, all that was left was the software. And by “all that was left,” I mean the remaining 90% of the work. Not long ago, getting a microcontroller to emulate a USB human input device for a prototype would have been an ordeal. With the introduction of boards like the Arduino Leonardo, however, this is almost as easy as writing any other Arduino sketch. Almost.

For some reason, the standard Arduino library offers only limited keyboard emulation. You can ‘print’ characters as key presses, but you can’t send specific key codes: you can send the character 9, which comes out as the 9 key at the top of your keyboard, but you can’t send the number pad 9 key. This can be easily fixed, but it requires modifying part of the Arduino’s standard library.

(more…)

 
 

Check out my (Atari key-)Pad, Part 1: Hardware Archeology September 2, 2013

Filed under: New project!,The Atari Keypad Project — Stokes @ 2:27 pm

Atari Keypad to USB A while back, a surplus electronics catalog was offering vintage Atari numeric keypads. Specifically, it was the Atari CX85, introduced sometime around 1982, intended for Atari 800 computers*. I have a thing for input devices, so of course I picked up a couple. It’s a hefty unit, housed in 70s/80s earth tones, with the ubiquitous Atari unshielded female DB9 connector. Its 17 keys have a nice, chunky feel to them. My goal: get this keypad attached to a modern computer — without any permanent modifications.

One thing leapt out immediately: 17 keys. I had to recount them to make sure I wasn’t seeing things. 16 keys is typical of a keypad, with keys wired in a 4×4 matrix. Having a prime number of keys is kind of bizarre. My initial thought was that maybe it contains a 4×5 matrix and some number of possible keys are just left out; that would fit a 9-pin connector, but I realized that the keypad has to be compatible with the Atari joystick port. In addition to +5V and ground pins, the joystick port has only five digital and two analog pins: the four cardinal directions, the ‘fire’ button, and paddle inputs. What’s more, the pins are input-only, so unless the keypad switches are DPST (unlikely), there’s no way the computer could scan the keypad (supplying power to each column or row to see which button is pressed). There had to be some logic in there.
(more…)