PSX to N64 Controller Adaptor

 

This page contains all the information - binary, schematics, source code and instructions - about my adaptor to use Playstation 1 and 2 controllers on a Nintendo 64 console. It was implemented in the microcontroller PIC16F688 from Microchips, but it can probably be ported with minimum effort to other mid-range PICs.


Features:

  • Great gaming experience!
  • 100% assembly code for low latency: 200us to 1.5ms.
  • Analog stick with corrected range (~63%), and deadzone of 7% (can be changed before flashing). This configuration allows very high precision to let you play any N64 game with ease.
  • Buttons are not hardcoded - user can have configure until 3 button presets before flashing. The button mapping can be changed during game directly from the controller.
  • Works with genuine Dual-Shock and Dual-Shock 2 controllers (not tested with 3rd party ones).
  • Hardware very simple to build - all the hard stuff is done in software.
  • Source code available.

 

Motivation for this project:

Nintendo 64 controller has a very good analog stick. It has a smart mechanical arrange that allowed progressive resistence force with the movement, allowing player to keep the analog in a fixed position more easily. This feature is not present in all analog controllers.

It also featured an optical movement detection instead of the potentiometers used at the time, or magnetic coupling used nowadays. For each axis, there is a disc with small holes in the border connected to the analog mechanism, with a laser-detector pair aligned to these holes. When the analog is moved, a circuit the times the laser is interrupted, and therefore the number of holes the laser has gone through, so it's able to know the distance that the stick has moved. The advantage of this system over potentiometers is that this optical process does not involve intermediary analog quantities that can be disturbed by noise or non-linearities. In the case of potentiometers, the analog intermediary is the voltage level. The practical consequence of this optical system is increase in the precision, so if a player is aiming in a FPS game and keep the analog in a fixed position, the crosshair will stay steady, not trembling.

However, N64 analog stick has a severe problem (not related with the detection method): it won't last long. All the analog mechanism is built with plastic, and the friction with the use will make the pieces wear down. Here are some pictures, courtesy of George Tremoulis (taken from this article):

n64damaged1 n64damaged2

The problem of these damaged analog sets are: increase of deadzone, decrease of controller maximum range and analog sticks harder to move. With the use, the controller eventually will become unusable.

Well, I like retrogaming so I bought a Nintendo 64 for my collection. The controller that came with it had the analog stick very damaged (not a surprise since the console was discontinued about nine years ago),  so I started looking for options. Unfortunately none of the them were good to me, here is a list:

  1. Buy a new genuine N64 controller. PROBLEM: Impossible to find, since community already consumed all the available controllers.
  2. Fix the analog of my controller. PROBLEM: The only solution I found on the internet was "padding" the damaged parts with tape, and no matter how careful you are in the process, analog will never feel the same as new.
  3. Buy a 3rd party N64 controller. PROBLEM: There were still some new no-brand controllers being sold last time I looked, but their construction was very poor. The main problem was (again) the analog stick, that was built with cheap potentiometers, so they were very imprecise and had a very high deadzone. I also looked for used 3rd party controllers, and the only good one I found out was a japanese model called Hori Mini. The problem was that people were asking US$70 for it, way too expensive for an used controller.
  4. Buy a controller adaptor. I found this guy selling Game Cube to N64 controller adaptors, and they looked very professional. Additionally, the guy made the project files free so anyone could build his own circuit. The reason why I didn't get this adaptor was that its price + new Game Cube controller + shipping was too high for my country - at the time this article was written, a new genuine Game Cube controller was not very easy to find and price was about US$40.
  5. Replace analog stick by a 3rd party one. PROBLEM: I found some Game Cube analogs adapted for Nintendo 64 controllers that promised to be the perfect replacement. The problem with them is that N64 controllers have each axis (X, Y) expressed as a byte (256 values), meaning each direction can logically have 128 values (one of them actually 127 because of the value zero). However, the real controller can only reach ~63% of this range (precision probably limited due the holes spacing in the disc used for detection of position). Game Cube analog uses the full range, which results in a very high sensitive controller when it's used in a Nintendo 64. It makes games that require precision unplayable, and cause glitches in others.

Since I was out of great options, I decided to create my own.

 

Why to use Playstation controllers?

Genuine Playstation 1 and 2 controllers are easy to find, even after so many years. The reasons are that they have been used for two consoles (three, if you consider retrocompatibility), Sony consoles have history of being long supported and are very popular.

Playstation controllers also have a lot of buttons, making it ideal for practically any game - if configured correctly of course.

Another advantage of Playstation controllers is that they are very durable. I have an eight years Dual shock that have been intensivily used and still feels like new.

Finally, Playstation protocol is simple and very well documented.

 

Why did you choose PIC16F688?

When I started the project I decided to use PIC right away. The reason is that they are cheap, popular, easy to find and easy to flash. Another reason is that there are some similar projects out there using PIC (Cube64-DX, micro-64-controller), so I could use some reference if I get stuck. Fortunately it wasn't necessary.

This specific PIC model was chosen because I could find it easy and there was a lot of program memory. I never had to try to use a simplier model since I never intended to build them for sale.

 

Do you build adaptors for sale?

No.

If you're interested in pre-programmed PICs and don't have the equipament for that, please enter in contact. Depending on how many people ask for it I can buy a lot, program and ship them.

 

What can I do with the source code?

This code is under a custom license, please check the included LICENSE.TXT. I understand this is not a good practice, but I couldn't find any license that served the purpose I wanted.

It basically says you can't use this project for commercial purposes, including selling adaptors or pre-programmed chips, without my permission. You're also now allowed to distribute modifications without permission.

I'm a nice guy, so I will probably give you permission if you ask.

 

Building an adaptor:

You can build the adaptor with the following schematic:

scheme

The components indicated in the diagram are the following:

  • Pre-programmed PIC16F688 microcontroller with the firmware available in the next section. You can buy the clean chip online for under US$3, but you will need special equipament to flash it. There are plenty of options available:
    • Official programmers, the safest and most expensive option.
    • 3rd party USB programmers. I use a DIY-K150 that can be bought for US$10 on eBay. Very recommended.
    • 3rd party RS-232 programmers. You will need an old computer with a serial port to use that (RS-232->USB converter will most likely not work).
  • C1, C2 = 33pF. You don't need much precision for these capacitors, so you can use other values around this. What really determines these values are the crystal you are using.
  • OSC = HC49S. Other 20mhz quartz crystal models should work too. Please notice N64 protocol is assyncronous, so adaptor relies on the clock precision to work.
  • LED1, LED2 = 20mA LEDs, any color you want.
  • R1, R2 = 150ohm. If you're not using 20mA LEDs, you can calculate the resistors considering a 3.3V voltage.
  • 3 PINs connector = N64 port connector looking at the connector in the controller (male), not the connector of the console. You can get a connector three ways:
    • Buy an N64 controller extension cord and cut off the female side. It's the recommended method since they can still be found cheap.
    • Get a damaged N64 controller you won't use anymore and cut the cord to use it.
    • Use the trick shown in this site - cut the controller cord in half and put an intermediary connector. This way you will be able to use the cord in the adaptor and in the original controller. I don't like to mutilate working controllers, but it's your choice.
  • 9 PINs connector = Playstation port looking at the connector in the controller (male), not the connector of the console. You have the same options above to get a connector, except that this time you are interested in the female side.

LED1 + R1 indicates when the adaptor is connected and the console is turned on. You don't need it in the circuit to make it work, but I recommend keeping it.

LED2 + R2 is used for button mapping preset indication. Not necessary, but useful if you keep it.

Here is a picture of a (poorly) assembled adaptor:

Assembled adaptor

 

Changelist:

== 1.1 ==
Dec 21th, 2012

- Added support for 1 to 3 button presets. Use the included
Ruby scripts to generate the presets. Presets can be switched
by turning off the analog mode and pressing X - LED will blink
one time for Preset 1, two times for Preset 2, etc.
- Fixed the random button pressing when there is
controller connected - now it will hold the last state.
- Included tool for configuration of deadzone - should fix
problems with older / 3rd party Playstation analog sticks.


== 1.0 ==
Nov 3th, 2012

- Initial release.

 

Firmware (download):

PSXtoN64 Adaptor 1.1 - Binary - Hex file. In case you are not sure, get this one.
PSXtoN64 Adaptor 1.1 - Source - You will need to assembly the program from source if you want to be able to change the default deadzone or add new button mapping presets.

If you want to build the firmware from the source, the easiest way is using MPLAB (available for free here). Open the project, right click on main.asm and click "Assemble". Right click in the project and click "Make". Then you can create the .hex file using File -> Export.

 

How to use the adaptor:

  • Plug the controller in the adaptor, and the adaptor in the console.
  • Once you turn on the console, the indicator LED in the adaptor will turn on as well.
  • Controller will start in digital mode - adaptor will ignore the buttons. Manually turn on the analog mode in order to make the buttons work.
  • In case you want to change the button mapping preset, turn off the analog mode and press X. Each time you press X, you will advance to the next available preset. The LED will indicate which profile you are in - it will blink once for preset 1, twice for preset 2, and so on. Turn the analog mode back on in order to exit configuration mode.

 

Default button mapping:

Nintendo 64   Playstation  
Analog Stick Left Analog Stick
C buttons Right Analog Stick 
A
B Square 
R R1 
Z L1 
L L2 
Start Start 

 

 

 

 

 

 

 

If you flash the binary, this is the only button mapping you will be able to use. Assembly from source if you want to configure new button mappings.

 

Compatibility list:

It worked with all the games I tested. Here is a list for reference:

  • Banjo-Kazooie.
  • Banjo-Tooie.
  • Goldeneye 007.
  • Legend of Zelda, The: Majora's Mask.
  • Legend of Zelda, The: Ocarina of Time.
  • Star Fox 64.
  • Wave Race.

 

Known issues:

  • Depending on the controller you are using, a 7% deadzone may high enough, and you will notice analog pending to a specific direction even not touching it. It will happen mainly with 3rd party controllers (bad analog sticks!) and old controllers. One thing that may help is to cycle the analog around all this range after turning on the console - it will help the controller to calibrate its center. If it doesn't solve the problem, you will have to increase the deadzone. Download the source and follow the instructions inside if you have to do it.

 

Troubleshooting:

If your adaptor is not working, here is a checklist that may help you:

  • Check the electrical contacts.
  • Power LED does not turn on: You most likely inverted the N64 connector pins.
  • Power LED turns on, but you can't switch the controller to analog mode: You most likely inverted the PSX connector pins.
  • Power LED turns on and you can switch the controller to analog mode: Use a multimeter to verify the voltage in the PIC power pins (1 and 7), it should be around 3.3V. If it's OK your chip is damaged or the firmware wasn't correctly flashed. Did you solder the chip itself instead of using a socket? Heat may have damaged the chip. Did you use the "Verify" function of your programmer software after flashing the PIC?

 

Improvements desirable for next versions:

  • Set buttons to "not pressed" state if controller is disconnected.
  • Add support for feedback (Rumble Pack). It will require to modify the circuit to add a charge pump or an external power source.
  • Setting controller to analog mode automatically after turning the adaptor on.

 

Features that will probably never be implemented:

  • Add support for memory card. Nintendo 64 has 32kb, and would require an external EEPROM/flash chip, a better microcontroller or interfacing with a real memory card. None of these options seems simple.
  • Add more button mapping presets slots. Although it's very possible to do, I would have to change a lot of code.
  • Button and deadzone configuration during the game. Both are very hard to implement, and would not add too much value to the adaptor.

 

References:

 

Thanks to:

  • The authors of the documents used as reference.
  • Daniel Oliveira for the quick start in PIC development.