Dr. Scott M. Baker

Atari 5200 Playstation 2 Dual-shock controller adapter

by admin on Sep.24, 2018, under Electronics Projects

I already built a nifty handheld controller, and I should be enjoying my retro gaming experiences, but I couldn’t help building something new, so here is a PS2-to-Atari5200 adapter:

Purpose

This adapter allows you to use a PS2 controller on an Atari 5200 gaming console. The 5200 was notable at the time for its use of analog joysticks, but the controllers that shipped with the console are pretty lousy. They don’t self-center and they have a mushy annoying feel to them. The fire buttons aren’t very tactile in nature. The controller in my opinion just doesn’t feel or work good. Nevertheless, you have to give the Atari 5200 some respect for trying to be a pioneer in the technology.

As such, several solutions have been proposed for using alternate controllers. There are adapters for Atari 2600 digital sticks, adapters for analog PC joysticks, my own handheld controller, etc. I decided to adapt the basic technique of my handheld controller to a PS2 adapter.

The basic idea

The Atari 5200 uses analog controllers. For each axis it expects an analog potentiometer of approximate 500K.

The PS2 dualshock is an analog controller with a digital interface. It communicates with the playstation by use of the SPI protocol. This is a clocked serial protocol with dedicated directional IO pins (MOSI = Master Out Slave In, MISO = Master In Slave Out) and a chip select.

Interfacing an SPI peripheral is dead simple with a microcontroller, you can easily bit-bang the SPI protocol, sending the appropriate bits in and out and toggling the clock. Numerous articles have been written on interfacing a PS2 controller to an AVR microcontroller. For example, CuriousInventor breaks down the protocol packets, and sunil93 has some C code to use that protocol. Reading the PS2 controller is a straightforward matter of repeatedly the controller for thumbstick and button state.

Getting that information back to the Atari 5200 is the interesting part. I use the same technique in this project that I did for my handheld controller, a digital potentiometer. The digital potentiometer used in this case is an MCP42100. It interfaces using SPI (just like the PS2!) and provides a range from 0 to 100K ohms in 256 steps. Unfortunately, finding a 500K digital pot is problematic. Knowing that the Atari 5200 uses capacitor charge rate to measure the position of the potentiometer, it’s possible to stretch out our 100K digital pot to the same charge characteristics as the stock controller by adding some additional capacitance, in our case 0.22uF. The same trick is used to make 100K PC joysticks work on an Atari 5200.

NOTE:

The current revision of this project does not feature a logic level translator on the PS2 connector. This appears to work fine for Sony controllers, but is unknown for third-party controllers. It’s conceivable the lack of logic translation could damage a controller. Builder beward.

Schematic

The schematic is shown below:

Atari 5200 PS2 Controller Adapter Schematic

At the left is your standard matrix keypad, straight out of the 5200 schematics. It’s wired to the first of two DB15 connectors, for the primary joystick port on the 5200.

Top right is the microcontroller, an ATTINY861. I used it because it’s similar to the ATTINY85 that I’ve used before, but with more pins.

There are two MCP42100 digital potentiometers. Each of these implements two pots, one each for X and Y axis of a controller. Having two MCP42100 allows us to implement two 5200 controllers, for games like Robotron or Space Dungeon that expect two controllers to be used together.

The PS2 port is implemented as a 9-pin header. MISO, MOSI, SCK, and PS2_ChipSelect are connected directly to the microcontroller. 3.3V power is provided via a LM3940-3.3 regulator.

I also wanted to be able to hook into the start/pause/reset buttons, so I made some effort to try to interface the microcontroller to the matrix keypad, you can see this on PA4-PA7 of the microcontroller with an associated pulldown resistor network. I haven’t got this feature working yet, so it’s recommended you do not populate RN1.

There’s an ICSP header, SV2, that can be used for in-circuit programming using a usbasp programmer.

Implementation

Here’s a picture of the pcboard:

Atari 5200 PS2 Controller Adapter, assembled

A few construction notes:

  • The PS2 connector pigtail came from a PS2 extension cable. I cut the end off and used dupont-style pins and housing to connect to a 0.100″ right-angle header on the pcboard.
  • Reset button doesn’t matter, and will be removed from the next board revision.
  • Two DB15 connectors are present — if you’re only playing single stick games (i.e. not Robotron, Space Dungeon, etc) then you only need to populate the primary connector.
  • You’ll need some 15-pin extension cables to connect the adapter to the 5200. “Game” extension cables ought to work, but general-purpose DB15 extension connectors may run into issues fitting into the connector on front of the 5200 console. Atari just didn’t leave much room around the connector housings.

Bill of materials

Part Value Quantity Description Source
C1,C2,C5,C6 0.22uF 4 Monolithic Ceramic Capacitor Digikey, 490-7533-1-ND
C3,C4,C7,C8 0.1uF 4 Monolithic Ceramic Capacitor Digikey, 399-4264-ND (possible substitute 490-9145-3-ND)
C9 0.47uF 1 Monolithic Ceramic Capacitor Digikey, 399-14039-1-ND
C10 33uF 1 Electrolytic Capacitor Digikey, 493-14729-1-ND
IC1 ATTINY861 1 Microcontroller Digikey, ATTINY861A-PU-ND
IC2,IC3 MCP42100 2 Digital Potentiometer Digikey, MCP42100-I/P-ND
JP2 JP2E 1 2-pin header Digikey, S1012EC-40-ND (buy one, cut to size)
R1,R6 10K 2 resistor
R5 1K 1 resistor
RN1 0 DO NOT POPULATE Digikey, 4605X-101-104LF-ND
SV1 MA09-1 1 9-pin header, RA Digikey, S1111EC-40-ND (buy one, cut to size)
SV2 MA03-2 1 3-pin header, vertical (cut from same strip as JP2)
U$7-U$18 12 Tactile switch, white (qty 12) Digikey, 450-1649-ND
U$19-U$21 3 Tactile switch, red (qty 3) Digikey, 450-1804-ND
U$25 1 Tactile switch, black (Optional)
VR1 LM3940-3.3 1 3.3V regulator Digikey, LM3940IT-3.3/NOPB-ND
X1,X2 F-5200-CON 2 Female DB15 Digikey, AE10929-ND
9 female dupont-style pins Digikey, 952-2157-1-ND
1 9-pin dupont-style housing Digikey, 952-3122-ND

You will also need:

  • Programmer for programming the microcontroller, such as a TL866 or USBASP. See ebay.
  • PS2 extension cable, cut off the end

Github repository

This project is on github at https://github.com/sbelectronics/5200-ps2. This contains the source code for the microcontroller, hex files for the microcontroller, etc. Everything that you need to program the microcontroller is there.

PC-Board ordering

I will be selling off spare boards, and I direct people to the following thread at atariage.com: http://atariage.com/forums/topic/283267-atari-5200-playstation-2-adapter/

Leave a Reply


6 × = thirty

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

New Kickstarter Project!

Interested in Nixie Tube projects? Check out my new Nixie Tube Calculator project on Kickstarter.

Copyright Notice

All content on this website is copyright Scott M. Baker and may not be used or reprinted without explicit permission.

Violators will be eaten by a grue.