-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|455|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
spinal
Created : 27 April 2016
Edited : 27 April 2016
System : Mac

PS2 to N64 Adapter



Who here honestly can say that the N64 controller has stood the test of time? Those who even saw he design as a good one (me included) will also admit that the quality of the parts used resulted in what was essentially a poor controller. Through time the joystick broke down, even after as little time as 40 hours gameplay, until the thing was quite useless.
So I hatched a plan to use a PS2 controller on my original N64.

So I set off to create my own, here is is...



The case is from a ps2-usb adapter, which would you believe was cheaper than a ps2 extension cable? The insides use my trusty old Atmega32u2 AVR.

Special features include full accurate N64 joystick range, something I'm fairly sure no other joystick replacement or 3rd part controller has. 'Turbo' button (the select button will constantly flip the Start button on and off) and a 'half stick' button (Triangle), which will half the range of the unconverted analog stick values, doubling the precision. And last but not least, rumble is working on almost all of the games I tested. It doesn't work on some games, don't know why yet.

Button layout is as follows -
N64PS2
D-PadD-Pad
StickLeft Stick
ACross
BSquare
StartStart
C Up
C Down
C Left
C Right
Right Stick
LL1
RR1
ZL2, R2
TurboSelect
Half-StickTriangle


Here are some results from testing the analog stick, the red outline shows the ideal range that an N64 expects, the green is what the sticks can actually do. I tested my adapter, an official N64 controller and a new 3rd party controller.



For anyone who wants to make one themselves, here is the source -
PS2 to N64 controller adapter firmware source

The wiring is as follows

N64
13.3v VCC
2Data B0
3GND GND

PS2
1ACKD4
2N/C
3CLKD2
4ATTD6
5VCCVCC
6GNDGND
7RUMBLEVCC
8COMD5
9DATD3

 

Comments


Wednesday, 27 April 2016, 03:07
Jayenkai
Awesome work, Spinal!
I'm constantly amazed that little techy things like this are possible, with random parts, and bits of coding.
Some day, I really need to learn to do the whole electronics thing.
Friday, 10 February 2017, 11:02
spinal
Had a go at updating this, was going to add a screen and SD card, so that I could have a nice menu for setting up buttons and switching between rumble pak and memory pak.
However, it can't be done.
When testing the screen, just having it enables gets in the way of the controller timing (which has to be perfect) so the device will no longer function as an n64 controller.
Even worse, with the SD card reader enabled, the thing doesn't work at all and takes a good handful of tries to get the thing recognized in the arduino software to re-flash it.
I guess that's why nobody else has attempted to do this... you can't (with cheap parts).
Friday, 10 February 2017, 11:30
Jayenkai
How about having a config setting which turns on the LCD, but otherwise leaves it off..?
Or do you need realtime?
Friday, 10 February 2017, 12:12
spinal
The lcd cone uses an interrupt timer, as does the sd code. Once the timer is enabled it seems to cock the timings up for the ps2 and n64 controller code, which is bit-banged and relies heavily on the arduino running at the speed it's supposed to be running at. There are example of using the screen without the hardware timer, but at this point I would rather have SD functioning.
I think the only option is either re-write all of the ps2+n64 controller code to match the messed up timing, or get hold of a faster arduino, and re-write the whole thing top to bottom. Neither of which I can be bothered to do.
Friday, 10 February 2017, 15:01
Jayenkai
Sounds incredibly complicated!
Saturday, 11 February 2017, 03:41
spinal
It's pain in the arse. Especially since it only just works to start with.
Monday, 13 February 2017, 01:53
spinal
It's a bit of a pain to keep testing this thing... Compile and flash software, unplug from PC, run into other room, switch on TV and N64, load a game, see if it controls properly...

So...

I'm now working on a PS2->N64 controller adapter adapter.

That's right, to test the ps2 to n64 adapter, I'm making an n64->usb adapter... fun.
Sunday, 12 March 2017, 04:55
spinal
I have a major issue with this damn thing.
You can't read a ps2 controller fast enough to keep up with the n64 requests. It takes about 9.5ms to poll the ps2 controller, but the n64 has a habit of polling the controller as often as 1.6ms apart. So you end up dropping the connection. I can't for the life of me figure out how to interrupt the ps2 read if it detects the n64 polling because of how the insane routines work, you have to sit and wait for the n64 line to go rise, then wait for it to drop then wait 2 microseconds then poll the line to see if it's high or low etc. I either miss ALL of the ps2 data EVERY time, or miss all of the n64 data EVERY time. ARGH!

The only thing I can think of, is using two arduinos, one to communicate with the n64 and the other to communicate with the ps2 controller, then transfer the data between them faster than the ps2 reads. Never done anything like that before.
Sunday, 12 March 2017, 07:14
Jayenkai
Could you not do...



.. or can it not be done in bits, like that?!
Sunday, 12 March 2017, 09:31
spinal
the ps2 controller works at a fairly fixed 6.5 microseconds per bit, whereas the n64 takes 3 microseconds per bit and sends less data. So if at any point during the ps2 read, the n64 asks for data, it will go unheard and assume the controller has been unplugged.
Sunday, 12 March 2017, 09:41
Jayenkai
Damn complicated things!!!
Sunday, 12 March 2017, 10:26
steve_ancell
I would have said use an Arduino to be the middle man interface between the two things you are combining, but that would wind up needing a biggish box between to contain the Arduino.

Have you considered looking into PIC chips at all Neil, some of those are quite small and the circuit board could also be just a little bit bigger than the chip itself. You could program it to squirt out data within a 3 microsecond window while sucking in data from the PS2 controller.
Sunday, 12 March 2017, 10:49
spinal
A lot of people seem to use them for this sort of thing, never really considered it yet.

I've been messing with the code a little and got nowhere. I've been trying to time how long it takes between n64 requests and if is passes 1.8 milliseconds without a request then allow a ps2 read. Can't get it to work though. The n64 code is so sensitive that interrupts need to be disabled, which I assume kills the timer also. So either i'm doing it wrong, or it isn't going to work that way. I always have had trouble with timers.
Monday, 18 June 2018, 03:05
Jayenkai
Recent referals coming from Assembler Games.
Hi all!