Universal wireless controller for SNES, Saturn, N64, etc....

Started by micro, February 15, 2011, 03:06:53 AM

Previous topic - Next topic

public-pervert

Urgh! I guess it's just to reduce some noise (?).

I always chop the caps from cristals off when I do some mod.

What exactly is their function, if not to reduce noise?

I'll try it out tomorrow!  ;D

micro

Oh boy!  ;D
The 2 caps and the crystal, as well as some other internal components you can not see, form a crystal oscillator which provides the clock signal for the microcontroller. So please, never leave out those 2 caps. Also, the value of the capacitors has to be 22 pF, not 100 nF or something else. And better install those 2 caps inside the receiver, too. (I'm still impressed that you receiver was working without the caps...)

public-pervert

HELL YEAHHHH!! IT WORKS!! hahahahha  ;D

Now I'm pretty close to finish and close this thing up!

Just need to drill the LED and miniUSB holes  ;D ;D

Pics very soon!!  :P

micro

Congratulations, I guess you've learned your lesson about leaving out capacitors ^^

Mini-USB hole? So you're gonna use a lithium-ion battery instead of a rumble pak? What battery type did you choose?

public-pervert

Thanks man! You're awesome!  ;D

No rumble pak. I've rewired the whole n64 controller inside a WiiClassic controller  and used your another mod to use pot based joystick. The another joystick will the C's.

I've chosen some type of Mp3 player battery, it's rated at 440mah. Maybe this battery will last about a few hours.
I can replace it with a bigger battery if it lasts too soon through.

Yes sir! Capacitors won't be removed anymore  ;)

Konsolkongen

Hey micro. About this Saturn controller schematic you linked to earlier. These 4K7 resistors are supposed to go to Vcc, right? Which in my case with the infrared controllers and rechargeable batteries will be 2.4V.

http://i40.photobucket.com/albums/e236/Konsolkongen/Various%20mods/saturn.jpg

micro

@pervert: Nice, can't wait to see the pics... But please be careful with the battery. The mod doesn't have under-voltage battery protection integrated and relies on the onder-voltge protection of the ipod battery. I hope your battey has under-voltage protection, too. Otherwise your battery could get damaged...

@Konsolkongen: Yes, that's right. I wouldn't use 4.7k resistors, but 10k. (decreases current when buttons are pressed -> battery lasts longer).
Another tip: By using resistor arrays instead of single resistors you can save space and trouble. (The pin designated with a dot should be connected to Vcc = 2.4V, the other pins are connected to the lines you want to pull up (up, down, left, right, A, B, C, etc...))



Konsolkongen


public-pervert

It's done!! Just a little crappy iphone pic for now. I'll take better photos and show everything very soon  ;D


micro

Wow, that looks really great! (Although I'd prefer the original N64 controller design).
Also very neat stickers. And the case for your receiver looks terrific, too. Where did you get that from? :o

public-pervert

#90
Firstly, I bought a new cheaper USBASP programmer, and made nice little PCBs to burn each microcontroller. This is the ATTINY2313 circuit.

By publiccpervert at 2012-07-03

By publiccpervert at 2012-07-03


Reduced a official N64 controller board

By publiccpervert at 2012-07-03

Opened space for the N64 controller board

By publiccpervert at 2012-07-03

It fits =)

By publiccpervert at 2012-07-03

This is an ATMEGA8 and an NRF24L1+ for the receiver.

By publiccpervert at 2012-07-03

This is the receiver box i've built with acrylic sheet + CNC laser machine.

By publiccpervert at 2012-07-03

Take a look how small the charger circuit is. A MicroSD for size comparison.

By publiccpervert at 2012-07-03


This is the receiver before close. It was a really tight fit.

By publiccpervert at 2012-07-03

By publiccpervert at 2012-07-03

By publiccpervert at 2012-07-03

Lastly, the controller itself before close. On the first part, you can see the MiniUSB port for charging the battery, charging circuit, and the wirelles module.
On the second part you can see batteries, 3,3v regulator (under the left black tape), joysticks, ATTINY2313 to mimic the N64 signals to the wirelles module, and I used an ATMEGA8 again (under this black tape on the middle) to make the conversion POT JOYSTICK > PHOTO DIODE JOYSTICK

By publiccpervert at 2012-07-03

And the finished product. Personally, I loved it! :D

By publiccpervert at 2012-07-03

By publiccpervert at 2012-07-03

By publiccpervert at 2012-07-03

By publiccpervert at 2012-07-03

By publiccpervert at 2012-07-03

By publiccpervert at 2012-07-03

I doubt you can really see in this blury pic, but this is unfamous Mario in action, just to prove it works! :D

By publiccpervert at 2012-07-03

By publiccpervert at 2012-07-03

This is how I mapped de buttons


It was really fun to build! Hope you enjoy!

@Micro: I've built this receiver box with white acrylic sheet, cutted on a laser machine ;D

micro

Very, very nice work! ;D

Acrylic plastic sheets, laser-cutted WTF? I have to admit that I'm a little bit jealous =)


public-pervert

Thank you man! Knows you liked it means a lot to me!  ;D

Now I need to post it on every modding forums and see if it draw the attention of people out.

I'm certain it'll have a good repercussion!  8)


dracbat59

I love this to the extreme. Wish you sold one or the parts in a package at least (having trouble finding a US place that carries all the necc. parts)
public-pervert has an excellent idea for what I was thinking of doing (or trying to in the matter of beginners luck with failure waiting for me)

I  have an original Doc's Wireless Controller for the N64.
Would it be easier for me to just upgrade/update the signal? What or how would I go that route?

And could you help me with what I can do for the batteries because I have no enclosure for them and they overheat extremely.

kmksoulja

does anybody think it would be worth it to make and sell these?

micro

I've received quite some answers regarding the mod.

As stated in the instruction's disclaimer my schematics and program files are not supposed to be used in a commercial way. But ultimately I cannot prevent someone is making dollar or two by selling preprogrammed microcontrollers. But I definitely don't want to see people running a business by selling several of these controllers for a massive amount...

One thing I learned in the past year is that for the majority of people this mod is hard to accomplish (public-pervert, you're not alone). Even people that have basic knowledge of electronics and soldering run into problems. And if the controller doesn't work it's hard to spot the error.

So what I'm planning for the 2nd version of the mod is to make universal PCBs for the receiver and transmitter. If this plan works out then I think I can offer completely populated and preprogrammed PCB's, including the housing. This will make the mod much more easier and faster to do, especially for rookies.
In fact, I've already received the first batch of the receiver PCB's one or two months ago. You can have a look:  http://imgur.com/a/1XuEP

Designing the transmitter circuit & PCB will take longer as I want to include some more things like onboard battery charger, battery protection, undervoltage alert, etc...
The code will be rewritten, too. I want to have a (more) reliable RF protocol, as well as 10 different channels to choose from, and more.

I can't provide a date  (I'm really busy at the moment), nor a price tag for the PCB's  (I won't give them out for free, of course). The rough road map looks like this:

1.) Designing the transmitting PCB
2.) Rewriting the program code for the existing consoles
3.) Maybe adding support for other consoles (Neogeo will be the first one)

Stay tuned! :)




public-pervert

Micro, you turned it my favourite thread yet!!  ;D

It's a very, very great idea! Your PCBs is looking delicious man!  :o
So no more attiny2313?

Please think about adding a Gamecube to the list  ;D ;D

I can't wait to see more progress on this  8)

kmksoulja

gamecube already has a wireless controller. its called the wavebird. i am very interested in the SNES controller mods and will purchase them already made or the easier kit micro if u make them.

public-pervert

Of course I know that theres a Wavebird, but Wavebirds are not "cross console" compatible like these beauties that Micro made.
I would love the GC on the list more than any mod ever done  :)

duo_r

nice job perv! I love this mod, what would it take to get the code for PC Engine? Do you just need a system to pull data from?

public-pervert

Quote from: duo_r on July 19, 2012, 06:24:12 AM
nice job perv! I love this mod, what would it take to get the code for PC Engine? Do you just need a system to pull data from?

Out of my capability. I guess Micro can answer this question  :)

duo_r


Cant wait to see these become a reality!

Quote from: micro on July 12, 2012, 01:48:50 AM
I've received quite some answers regarding the mod.

As stated in the instruction's disclaimer my schematics and program files are not supposed to be used in a commercial way. But ultimately I cannot prevent someone is making dollar or two by selling preprogrammed microcontrollers. But I definitely don't want to see people running a business by selling several of these controllers for a massive amount...

One thing I learned in the past year is that for the majority of people this mod is hard to accomplish (public-pervert, you're not alone). Even people that have basic knowledge of electronics and soldering run into problems. And if the controller doesn't work it's hard to spot the error.

So what I'm planning for the 2nd version of the mod is to make universal PCBs for the receiver and transmitter. If this plan works out then I think I can offer completely populated and preprogrammed PCB's, including the housing. This will make the mod much more easier and faster to do, especially for rookies.
In fact, I've already received the first batch of the receiver PCB's one or two months ago. You can have a look:  http://imgur.com/a/1XuEP

Designing the transmitter circuit & PCB will take longer as I want to include some more things like onboard battery charger, battery protection, undervoltage alert, etc...
The code will be rewritten, too. I want to have a (more) reliable RF protocol, as well as 10 different channels to choose from, and more.

I can't provide a date  (I'm really busy at the moment), nor a price tag for the PCB's  (I won't give them out for free, of course). The rough road map looks like this:

1.) Designing the transmitting PCB
2.) Rewriting the program code for the existing consoles
3.) Maybe adding support for other consoles (Neogeo will be the first one)

Stay tuned! :)





pakam45t3r

Where's a good place to get the plastic pieces for the charger and the receivers?

busslave

Man... You must be an AVR god!
I've been struggling for 2 weeks now with my Saturn IR digital pad project, but I can't get it to work.
I'm using an Arduino UNO (ATmega328P) @16MHz for prototyping. The IR sender is working just fine.
The receiver reads sent signals OK too. The problem seems to be on getting the proper select lines readings.
The Select0 (or TH, or pad pin 4) is connected to AVR INT0 (pin2).
The Select1 (or TR, or pad pin 5) is connected to AVR INT1 (pin3). TL is tied to +5V.
I'm attaching the external interrupt the Arduino way: attachInterrupt(0, TH_changed, CHANGE), which should be equivalent to: EICRA=1; EIMSK=1. This enables external interrupts on INT0 pin toggle.
My ISR:
void TH_changed() { //
   address_request=(PIND>>2)&3;//Read Port D input pins, shift rightmost and clear leftmost bits.   //__asm__("nop\n\t");
   //address_request&=3;//Clear leftmost bits.
   PORTB=command_buff[address_request];//Write command nibble.
   debug_buff[db_ix++]=address_request;//DEBUG!!

busslave

Sorry, the message got truncated. There is no more code on my external interrupt ISR.

I'm also setting as default values:
command_buff[3]=12;//Saturn digital pad data for SH-2 direct mode.
command_buff[2]=7;
command_buff[1]=7;
command_buff[0]=7;
(I'm using 7 and not 15, because I'm expecting to see some cursor movement, even when the IR sender is off: it should move to the right).

In the main loop, when the debug_buff is full, I detach the INT0 interrupt and send the debug_buff to the terminal window. But instead of getting 3,2,1,0,3,2,1,0,... I always get 2,3,2,3,... This suggests that the TR pin is allways 1.

Please, help me, I'm getting desperate.
I understand the Saturn timings are brutal. The data nibble should be available 2us after the select lines change. That is 32 clock cicles@16MHz. Even if the console takes another 2us to read the data lines and change the select lines again (I don't know the actual timings), this means that after 4us the INT0 ISR will be called again, only leaving 64 clock cicles to deal with all the rest.

Could you please post your INT0 ISR, so that I can have an ideia of how you did it?
Using external multiplexers on the receiver side is not an option. Should I consider using SMPC control mode?
Thanks.

busslave

I'm posting my ISR routine again, without the comments. It looks like a total mess.

void TH_changed() {
   address_request=(PIND>>2)&3;
   PORTB=command_buff[address_request];
   debug_buff[db_ix++]=address_request;
}

micro

Quote from: pakam45t3r on August 05, 2012, 11:24:54 PM
Where's a good place to get the plastic pieces for the charger and the receivers?
I've always got them at www.reichelt.de, a German electronics shop:
Receiver housing (reichelt)
Charger housing (reichelt / conrad)


Quote from: busslave on September 06, 2012, 11:17:32 PM
Man... You must be an AVR god!
I've been struggling for 2 weeks now with my Saturn IR digital pad project, but I can't get it to work.
I'm using an Arduino UNO (ATmega328P) @16MHz for prototyping. The IR sender is working just fine.
The receiver reads sent signals OK too. The problem seems to be on getting the proper select lines readings.
The Select0 (or TH, or pad pin 4) is connected to AVR INT0 (pin2).
The Select1 (or TR, or pad pin 5) is connected to AVR INT1 (pin3). TL is tied to +5V.
I'm attaching the external interrupt the Arduino way: attachInterrupt(0, TH_changed, CHANGE), which should be equivalent to: EICRA=1; EIMSK=1. This enables external interrupts on INT0 pin toggle.
My ISR:
void TH_changed() { //
   address_request=(PIND>>2)&3;//Read Port D input pins, shift rightmost and clear leftmost bits.   //__asm__("nop\n\t");
   //address_request&=3;//Clear leftmost bits.
   PORTB=command_buff[address_request];//Write command nibble.
   debug_buff[db_ix++]=address_request;//DEBUG!!

Most likely you got a speed issue. You should definitely activate compliler optimization if that's available on your Arduino IDE. (I'm not familiar with Arduinos). My ATmega8 was running on 16 MHz, too. Yet it was still difficult to maintain the timings.

I wrote the code in ASM. Just like in your code my INT0 pin was configured to cause an interrupt when toggled. My ISR looked like this:
isr0:
IN r22, SREG     ;save status register

SBIC PIND, PD2
RJMP H
RJMP L
H:
SBIC PIND, PD3
RJMP HH
RJMP HL
L:
SBIC PIND, PD3
RJMP LH
RJMP LL
HH:
;L 1 0 0
OUT PORTC ,sathh
RJMP isr0_end
LH:
;R L D U
OUT PORTC, satlh
RJMP isr0_end
HL:
;START A C B
OUT PORTC, sathl
RJMP isr0_end
LL:
;R X Y Z
OUT PORTC ,satll
isr0_end:
OUT SREG r22 ;write back status register
RETI

The button data was stored in 4 dedicated registers (satll, satlh, etc...) for maximum speed. Loading from SRAM takes another 2 clocks to execute.
"The data nibble should be available 2us after the select lines change." It's even less than 2 us.  At the beginning the ATMega was running at 8 MHz. I was able to ouput the data nibble after 1.875 us. Even that was not fast enough...

BTW, this is how the Saturn is polling a standard digital controller, repeated every 16.67 ms...



Last week I was doing some research on the saturn controller protocol and I've completely rewritten my saturn code. I found out a very, very convenient way to communicate with the Saturn.
Say, you throw around with terms like "TH" and stuff so I guess you've read the Sega SMPC document?

busslave

Thank you for your fast answer.

Last night I changed the address variable to local, and I got the following results: 0,1,2,3,2,3,2,3,... So, the TR pin does change, after all. I's certainly not in the order I expected (I was expecting 3,2,1,0,3,...), but hey, at least I didn't blow up the console port.

I'm only guessing here, but it seems the console keeps repeating 2,3,... because the Saturn encodes the Peripheral ID in these nibbles. In my case, they are:

Nibble3 (12): 11 00
Nibble2 (07): 01 11

The Saturn peripheral ID is:

bit3: (1|1)=1
bit2: (0|0)=0
bit1: (0|1)=1
bit0: (1|1)=1

which gives 1011=11. According to the SMPC User's Manual, this is OK.

Actually, Sega seems to have followed some sort of MegaDrive/Genesis peripheral ID convention. Anyway, I already expected this result, that's why I chose 12 for the third nibble value. That's because:

bit3: (L TRG, don't care | always 1, tied to VCC inside the pad) = 1
bit2: (always 0, tied to GND | always 0, tied to GND) = 0
bit1: (RIGHT | LEFT) = 1, since they can't both be pressed.
bit0: (UP | DOWN) = 1, same here.

So I guess I'm dealing with a timing issue, after all.

Yes, I do have an optimization option, which is optimizing for size (I'm not using the Arduino IDE, I'm using AtmelStudi6 with the Arduino libraries). I'm a total noob (this is my second project) and I'm learning as I go. I've never dealt with ASM before, but I'll try to understand your code and implement your suggestions.

Many thanks, micro.



Game-Tech.us

I've been trying to build one of these for NES, but have failed and i'm wondering if the 4 transceivers I bought aren't all bad and how to test without them. Voltages are way out of spec when I plug them in to the circuit. I wasn't taking notes at the time, two months ago, but had an idea about it today:
Can I just wire certain pins from the 2313 to the mega8, bypassing the transceivers, to test that I programmed the chips right? This is my first ever attempt at MC prog uploading so I have no idea if I did it right, though it seemed to work as it was intended...

metrolf

Hey all! I have a quick question.

First of, a HUUGE thumbs-up to everyone who has contributed to this project, it's truly awesome!

Now for my question: In my case I'm thinking of eventually doing this to my N64 controller(s) and I was wondering: if I were to combine this with Kylejw and micros mod (using a for ex. a gamecube stick in the N64 controller, I'm sure most of you've seen it). To do this mod it seems I would have to go with a ATTiny chip which I understand draws less power than the ATmega for instance. I'm not quite sure of the power draw of the controller + the two chips used in the two mods. So, would combining these two mods result in a power-draw that leaves me with a sufficient battery-lifetime?

Would anyone care to enlighten me?  :)

micro

Quote from: flagoss on September 10, 2012, 03:12:29 PM
Here some cases I found on ebay !

1rst one looks exactly like the one Micro used !!
http://www.ebay.ca/itm/PLASTIC-BOX-ENCLOSURE-CASE-HOBBY-ELECTRONIC-PROJECT-ABS-E224-/130739375741?pt=UK_BOI_Electrical_Components_Supplies_ET&var=&hash=item642318e3b4#ht_2752wt_1139
Great find! I contacted the seller and he sent me a drawing of the enclosure: http://imgur.com/tIltf
The enclosure really seems to be based on the TEKO 10006 case I'm using. The measurements differ a little bit. Do you know other sources for this case? I don't think that ebay seller will provide the name of his source ;)


Quote from: akaviolence on September 19, 2012, 07:03:53 AM
I've been trying to build one of these for NES, but have failed and i'm wondering if the 4 transceivers I bought aren't all bad and how to test without them. Voltages are way out of spec when I plug them in to the circuit. I wasn't taking notes at the time, two months ago, but had an idea about it today:
Can I just wire certain pins from the 2313 to the mega8, bypassing the transceivers, to test that I programmed the chips right? This is my first ever attempt at MC prog uploading so I have no idea if I did it right, though it seemed to work as it was intended...
What do you mean by "the voltages are way out of spec"?
Unfortunately you can't directly connect the 2 microcontrollers. Even if they were on the same voltage level.
But here's what you can do: On the receiver side you can install a LED that will light when the receiver is receiving data :) Take a standard LED and a 50 to 100 Ohm resistor in series. Connect the positive leg to 3 V and the negative leg to pin no. 15 of the ATMega8 (a.k.a "IRQ").
If that doesn't help you can also make some good pictures of your circuit. Maybe I can spot something =)


Quote from: metrolf on September 19, 2012, 07:17:36 AM
Hey all! I have a quick question.

First of, a HUUGE thumbs-up to everyone who has contributed to this project, it's truly awesome!

Now for my question: In my case I'm thinking of eventually doing this to my N64 controller(s) and I was wondering: if I were to combine this with Kylejw and micros mod (using a for ex. a gamecube stick in the N64 controller, I'm sure most of you've seen it). To do this mod it seems I would have to go with a ATTiny chip which I understand draws less power than the ATmega for instance. I'm not quite sure of the power draw of the controller + the two chips used in the two mods. So, would combining these two mods result in a power-draw that leaves me with a sufficient battery-lifetime?

Would anyone care to enlighten me?  :)
I can't speak for Kylejw and his PIC solution. But I hadn't have a low power consumption in mind when I made the circuit/program.
So a few minutes ago I measured the current consumption of my attiny24 solution and the consumption of the original photo-diode-based stick. BIG surprise:
N64 pad with original stick: 16 mA
N64 pad with potentiometer joystick and attiny24: 7.5 mA
N64 pad without stick: 4 mA

It turned out the original stick is VERY power hungry. I always thought the N64 controller itself has such a high current consumption but it's just the stick. Wow...!  ;D
So yes, you can use the attiny24 mod with the wireless N64 controller mod, it will even increase the runtime =)

metrolf

Quote from: micro on September 19, 2012, 10:12:42 PM

I can't speak for Kylejw and his PIC solution. But I hadn't have a low power consumption in mind when I made the circuit/program.
So a few minutes ago I measured the current consumption of my attiny24 solution and the consumption of the original photo-diode-based stick. BIG surprise:
N64 pad with original stick: 16 mA
N64 pad with potentiometer joystick and attiny24: 7.5 mA
N64 pad without stick: 4 mA

It turned out the original stick is VERY power hungry. I always thought the N64 controller itself has such a high current consumption but it's just the stick. Wow...!  ;D
So yes, you can use the attiny24 mod with the wireless N64 controller mod, it will even increase the runtime =)

Huh, glad to be able to lead you to that discovery!  :D In hindsight, considering the fact that the original stick is based on photo-diode technology makes perfect sense when trying to figure out why the controllerboard draws so much power. Very nice find! I guess we can conclude that we would actually benefit from installing both mods. We get the great gamecube stick instead of the old piece of cr*p AND the runtime of the controller will be increased. Awesome 8)

rhys79

Ok, never mind, after several hours of investigation, I answered my own questions.  This should be interesting.....

Fionamac83

Hey guys!! I'm new to the forum and am desperately trying to follow this thread and the instructions so that I can make my own controllers.  I am a complete noob to all of this, so please forgive me for probably sounding like an idiot.  I have managed to create a charger for the controls, and am now trying to move on to creating the controls themselves.  My problem is that I have absolutely no idea how to program the Attiny2313 or the Atmega8.  I bought a Usbasp programmer, and I would like to make a board like public_pervert did for them, but so far I have not even been remotely successful at it.  I used Eagle to make my own PCB's for the charger, but have failed miserably at making them for the programming boards.  Any help or advice is massively appreciated and thank you guys in advance!!

Fiona

micro

Fiona, if you're really a complete noob then you should better stay away from eagle ;)
You don't need a PCB to program the microcontrollers. You just need to connect 6 wires from your ISP programmer to the microcontroller (VCC, GND, MISO, MOSI, SCK, RESET).
In the .zip file there are schematics showing which wire goes to which pin to program the microcontroller.
See also: http://www.ladyada.net/learn/avr/programming.html

leonrrafael

#118
Cant wait for GENESIS/MASTER tutorial.  :D