I've been discussing a microcontroller project with koitsu if anyone's interested. How hard would it be to make an MCU read a DualShock and output PWM?
Several old computers and video game consoles are designed to use paddles (non-centering absolute rotary inputs) or 2-axis analog joysticks:
- Apple II: DE9, 2 to 4 paddles or 1 to 2 2-axis joysticks, 3 buttons
- Atari 2600: 2 paddles, 2 buttons
- Atari 5200: 2 axes, several buttons
- IBM PC game port: 4 axes, 4 buttons
All these are potentiometers (variable resistors), normally read by passing a voltage through the pot, feeding the output to charge a capacitor and waiting until an NE555 or compatible timing comparator determines that the cap has charged to 2/3 of reference voltage. (See description of Apple II paddle circuit
.) The trouble is that the existing stock of paddles and joysticks are wearing out, and it's also becoming hard to find repair parts such as 150 kilohm pots.
So I thought of a solution: use pulse width modulation (PWM) instead of variable resistance. Output high Z on the pin for an amount of time proportional to the position of the stick, and then slam it to Vcc momentarily. The circuit after the comparator shouldn't be able to tell the difference, should it?
In fact, almost the same protocol would work for the Zap Ruder tech demo
, which waits between the top of the screen and when the Zapper's photodiode turns on. Except the "zapkernel" (input routine of Zap Ruder) expects a light pulse that dissipates after 25 lines or so, so it can tell the difference among a Zapper pointed at the screen, a Zapper pointed off-screen (dark for the whole frame), and no Zapper at all (always light even during vblank).
So the idea is to make a microcontroller read a DualShock controller
and convert the joystick position from PCM to PWM.
Because joysticks are auto-centering and paddles aren't, a useful "paddle mode" for such an MCU may require a different form of input translation where the pulse width is proportional to arctan2(x, y), with readings held when the stick is near the center dead zone.