Latest Uploads
Shields 64x64

Pakz

Ffs_Spam

Jayenkai

Hives Screen shot

rychan

Rpg Potion Sprites

Pakz

Super Shap ... ration Kit

Andy_A

Platdude Spotting

Jayenkai

Back to spinal's Blog ( Created 27 April 2016 | Last Edited 27 April 2016)
Development Diary : 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...

Highslide JS

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

Latest Comments

Posted : 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.

Homepage : http://AGameAWeek.com
Posted : 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).

Homepage : http://spinalcode.co.uk
Posted : 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?

Homepage : http://AGameAWeek.com
Posted : 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.

Homepage : http://spinalcode.co.uk
Posted : Friday, 10 February 2017, 15:01
Jayenkai


Sounds incredibly complicated!

Homepage : http://AGameAWeek.com
Posted : Saturday, 11 February 2017, 03:41
spinal


It's pain in the arse. Especially since it only just works to start with.

Homepage : http://spinalcode.co.uk
Posted : 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.

Homepage : http://spinalcode.co.uk
Posted : 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.

Homepage : http://spinalcode.co.uk
Posted : Sunday, 12 March 2017, 07:14
Jayenkai


Could you not do...

-->

.. or can it not be done in bits, like that?!

Homepage : http://AGameAWeek.com
Posted : 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.

Homepage : http://spinalcode.co.uk
Posted : Sunday, 12 March 2017, 09:41
Jayenkai


Damn complicated things!!!

Homepage : http://AGameAWeek.com
Posted : 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.

Homepage : http://homepage.ntlworld.com/stephen.ancell/index.htm
Posted : 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.

Homepage : http://spinalcode.co.uk
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 724|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Latest Posts
Pokitto
Jayenkai Sun 02:00
Arduboy Owners Club
spinal Sun 01:35
Slow News
Jayenkai Sat 23:36
AGameAWeek : 2017 - Part One
Jayenkai Sat 08:31
Facebook Group
rskgames Fri 10:47
Possible LCD experimentation imminent.
steve_ancell Fri 10:30
1-2-...Never Mind
rockford Fri 07:12
Buy Zelda
rockford Wed 16:00
What Have You Done? - April 2017
rychan Wed 06:43
I Hear Voices
Jayenkai Tue 04:30
More

Latest Items
Showcase : Read Error A
Jayenkai Sat 08:28
Showcase : Hives
rockford Wed 12:53
Showcase : Quadoban
rskgames Fri 10:11
Blog : My Arduino experience.
steve_ancell Wed 17:02
Showcase : Roguelike Explorer
Pakz Fri 06:59
Showcase : Infinitron
Jayenkai Mon 07:50
News : Newsletter #311
Jayenkai Thu 17:27
Link : Super Shapes Exploration Kit
Andy_A Thu 11:09
Dev-Diary : Sensitive - Arduboy!
rychan Thu 17:27
Snippet : Skylines
steve_ancell Tue 14:25
Dev-Diary : PS2 to N64 Adapter
spinal Sun 10:49
Link : Vector Tutorials/Help page.
Pakz Thu 23:00
Blog : mini project
spinal Sun 10:13
Snippet : Wall Tracing on Random Maps (rpg)
rskgames Wed 22:48
More

Who's Online
Krakatomato
Sun, at 04:23
Jayenkai
Sun, at 04:03
spinal
Sun, at 03:15
rychan
Sun, at 02:55
Pakz
Sun, at 00:57
rskgames
Sun, at 00:07
steve_ancell
Sat, at 20:01
Evil Roy Ferguson
Sat, at 15:43
rockford
Sat, at 10:31
zzoom
Fri, at 16:24
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.