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

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

Previous topic - Next topic

GoodSeed

Great thx.  According to the schematic, that will put 5V from the USB power to the transceiver.  Is that ok?  Should I tie in the power upstream of the regulator( on leg 3)?


(UPDATE) I will answer my own question and say yes, of course incoming 5v power should go through the regulator first, that's probably why it's there!

micro

No no, Vcc coming from the ISP socket/ISP programmer should be connected directly to Vcc of the microcontroller.

If you plan on programming the MCU with all the other parts in place (transceiver, regulator, etc.) then I suggest you turn off the voltage of the programmer. When you do In-System Programming you should never provide +5 V to the MCU as this will damage the transceiver because Vcc of MCU and transceiver are connected. Instead turn off the voltage of your programmer and just use the voltage the system is providing (console or controller with battery).

Which console are you working on? Transmitter or receiver?
What kind of programmer are you using? =)

GoodSeed

Hi micro, thanks for the response.  I do plan on programming the MCU with all the other parts in place.  I am using this programmer.  I will admit i have never used one of these before.  I am working on the SNES transmitter.

Sorry if I am a bit confused, but from what I gather from your other post, I wire the Vcc from the programmer to Vcc of the circuit, but can "turn off" the Vcc in the programmer?  Is this accomplished through software?  If you say to wire up the Vcc directly, then that is what I will do!  I will need to figure out the rest through the programming software.

micro

Yes, that's correct. The Vcc pins of MCU and ISP socket must be connected directly. Normally to be able to program the  MCU when the system is running (ISP = in-system programming) the programmer expects that the system is providing power to the MCU.
Modern programmers have the ability to provide power to the MCU by themselves but in some cases that may damage other parts of the circuit. So it would be best to turn off the voltage and let the console power the the wireless circuit, then program the MCU.

Apparently your programmer is based on the design by Thomas Fischl: http://www.fischl.de/usbasp
I don't own that programmer but there's a readme: http://www.fischl.de/usbasp/Readme.txt

So the reference circuit of that programmer is only suitable for in-system programming circuits with V target of 5V.
But on your programmer there seems to be a jumper or switch for selecting between 3.3V and 5V. If you can't turn off the voltage of you programmer, then at least make sure you're providing 3.3V to the circuit and not 5V.

Ecsar

 ;D good job men Micro, do you think is possible make this, with a playstation controller (ps1) o with a xbox360 controller wired?

thanks for this contribution.

micro

I'm planning PSX support in the future. But I guess Xbox360 won't be possible...

Lo!o

Hy everyone, Hy micro.

First, i want to thank you for that magical idea.
Just let me ask you for something:

In the pdf tutorial, at the beginning, you are talking about ATTiny2313.
In the programming schematics ATTiny2313-*P*

I have searched for ATTiny's in my country, and on a merchand site, they have ATTiny2313 @ 20Mhz
and ATTiny2313 @ 10Mhz.

Which one is good for the wireless controler mod job, please.

Yesterday, i have already flash two ATTiny2313A and two ATMega8, but did not start built the controller.
If the Tiny's ref is not good, would it be critical for running or not ?

It would be nice you answer, and i thank you so in advance.

Regards.

Lo!o

public-pervert

hey micro! is the bascom demo (limited to 4k of code) version enough to flash these microcontrollers?

micro

@public-pervert: I don't think you can flash foreign .hex files with Bascom. Instead use one of the other ISP programs proposed in the PDF.

@Lo!o: The "P" in "ATTiny2313-*P*" stands for PDIP (Plasic Dual In-Line Package). It's not a different typ of microcontroller. It shouldn't matter if you got the 20 MHz or 10 MHz version, though I used the 20 MHz version.

SGGG2

Quote from: micro on January 04, 2012, 10:16:34 PMI no longer own PCE and Mega Drive, but there will be support for other consoles sometime =)

I would gladly donate so you could purchase said consoles :)

Lo!o

Quote from: micro on January 21, 2012, 10:42:38 PM
@Lo!o: The "P" in "ATTiny2313-*P*" stands for PDIP (Plasic Dual In-Line Package). It's not a different typ of microcontroller. It shouldn't matter if you got the 20 MHz or 10 MHz version, though I used the 20 MHz version.

Ok, thanks micro, with that explanation, now i can continue building my controllers.

flagoss

Hey micro would be cool if you could do a atmega8 version of the TX firmware since they are cheaper than the attiny ones. I am willing to test theme for you !

micro

Hmm, normally Attiny2313's are significantly cheaper than Atmega8's. They also consume less power so they last longer when running on the battery inside the controller.
Unfortunately it's not a 2 minute job to port the program from the Attiny2313 onto the Atmega8. So you better find another purpose for your 20 Atmega8's, sorry =)

NFG

This thread has received 260 hits from Russia today. 

Hello, Russia!  =)

micro

I've also experienced a massive rise of views for my youtube video.
I guess this is caused by gamesx user ericmerl. He has built the wireless SNES controller and dedicated an imgur album to it which got viewed 2.5 MILLION times in few days. Sick...  ;D
Here's the album: http://imgur.com/a/8H3Ci


Today I've finally added support for the NES transmitter. Until now there was support for the NES receiver only. For the .hex file and schematic see the first post of this thread or the description of the youtube video.

Justin2808

Hey Micro.

I got my wireless snes controller to work, but there is a small problem with my transmitter circuit. According to the schematic I have to connect SNES_PAD_VCC (white cable of the controller) to pin 6 of the attiny. I tried that, but when I do, the circuit does not work. The only way to get it to work is to connect SNES_PAD_VCC to a +5V VCC of a power supply. That way the controller runs on 5V and the rest of the transmitter circuit on 3V. This way I got everything working.

Do you have an idea what might be the problem here? Is pin 6 on the attiny suppose to deliver +5V to the controller? Because it is not putting out much voltage, only about +0.20V.

One more thing, when I program the atmega8 or attiny, programming is succesful, but I do get warnings saying "cannot set SCK period. please check for usbasp firmware update". Maybe that has to do with my problem?

I hope you can help me with this problem.


micro

Justin, you can't just provide +5V to the controller and let the microcontroller run on +3V, this will damage the microcontroller!
I'm not sure what's the reason for the problem you described. But you can try to connect the controller's Vcc (white wire) to pin 20 of the microcontroller (+3V)  directly. Keep me posted if it works. If it does it's probably just a timing issue and I'll try to fix the hex file...

You're measuring 0.2V instead of 3V on pin 6 because most of time the controller PCBis not powered.

Regarding you USBasp error: I don't have a clue, never had a USBasp programmer....

Justin2808

Micro, thanks for the quick response. I tried connecting the controller directly to the VCC of the microcontroller, but that does not work either. It seems like the controller does not want to run on 3V. 5V just fine, but 3V does not work.

I also connected another snes controller to the circuit instead of the one I have been using so far, but that one does not work either. So it is not my snes controller.

As far as my USBASP problem goes, I found out on the internet that the programming clock rate of my USBASP programmer is too high for the Attiny. I ordered another programmer which I can set at a slower clockspeed. From what I've read this should solve the warning "cannot set SCK period". Maybe not being able to "set the SCK period" is causing trouble, but I'm not sure if that matters.

micro

It's really strange. As far as I know the 4021 IC on the SNES controller PCB should work with Vcc of 3V. Is it an original Nintendo controller or a 3rd party one? US? PAL?

Also, did you set the fusebits?

Justin2808

I tried 2 controllers, an original PAL snes controller and a cheap 3rd party one. Both did not work. Also I did set the fusebits. I used MyAVR ProgTool to program the controllers, but that shouldn't matter I think.

Justin2808

Micro, I got everything to work now. I replaced the 10k resistors. I used bigger 1W resistors at first, because the 0.25W carbon film ones, were not available at that particular store at that time. I thought it would work just as well, but I guess it doesn't. Yesterday I did get the proper 0.25W resistors and now everything works!

Also at first the two wireless modules were powered by the same 3V power supply, since everything was still close together on the breadboard. I now powered them separatly, the way it is in the schematics.

I guess the circuit drew to much power for the snes controller to work. That's the only thing I can think of since I do not know electronics that well. But anyway all is working now, it was my own stupid mistake, sorry for the inconvenience. Thanks for the quick responses and it is a very cool project indeed!

I'm gonna solder everything everything together know, hope everything still works after soldering.


public-pervert

Hello Micro!

I've heard that the N64 and GameCube controller protocol is very similar. Is it true?

Would be awesome if you implement your code to GCs!! Have you ever think about it?  ;D


public-pervert

Of course i've heard  :) hahahah

But it'll allow GC controlller to play with all consoles that you've built this beauty. And make your awesome project bigger and bigger.
Aswell wavebirds are so much expensive and going to be rare.

I'm just an annoying guy giving my opinion  :)

froozeR

Wow, awesome work.

I realy enjoy playing SNES together with a friend wireless. You postet a channel 3&4 version for N64.
I would like to play with 4 players wireless, is there a chance that you can post a channel 3&4 version for SNES? That would be great.

Thank you.

Justin2808

Hey Micro,

I got my snes controller to work. Really love it, so thanks for it all. Now I would like to build a wireless n64 controller, but whithout the rumble pack housing. It seems there is more than enough room for the electronics in the standard controller. Could you provide me with a scheme where I can use a standard conroller yo make it wiereless, possibly with rumble support? Thanks anyway

Regards,
Justin

micro

@froozer: I don't know, right now I'm pretty busy. If you've built 2 controllers and are content with the result, then maybe I will release the .hex files for ch3+4.

@Justin:
Rumble: no, it doesn't work (as stated in the instructions)

If you want to use a lithium battery inside the N64 controller, well then you should use the voltage regulator circuit as used in the SNES controller. Just have a look at both schematics and compare.
But as I stated (in the instructions) the N64 controller has a high current consumption. You better find a bigger battery than the Ipod battery. And it should also have an  included under-voltage protection just like the Ipod battery...


Other news:
I found out that there are professionally-produced wireless SNES controllers now, mady by "retro-bit"
http://www.innexinc.com/product_detail.php?prod_id=RB-SNES-6621&brand=65&page_num=2
The price is VERY good and the box looks very nice too. Unfortunately in my opinion over 90% of third party controllers just suck. But I really wonder how good these retro-bit controllers are =)

It seems retro-bit makes other crazy accessoires too, like an adaptor to play NES or Genesis games on the SNES....

kmksoulja

i just want to say that i would buy every one of these if you ever wanna start selling them

Konsolkongen

#69
Hey Micro. Do you think it would be possible to adapt this mod for the official Infrared SEGA Saturn controllers too?
http://i40.photobucket.com/albums/e236/Konsolkongen/Various%20mods/DSC00495-1.jpg

It uses a different IC and the pinout does not match the other one at all, so I guess it won't be that simple. I haven't been able to find a datasheet of this IC either :(

The SEGA wireless controllers are just as good as the normal ones and the dongle they use are big enough to easily fit this mod into as well. They also have a 1 or 2 player switch that could be used for channel selecting (perhaps work as ON/OFF (center OFF) at the same time?) and they take two AA batteries, so they would be perfect for this mod :)

public-pervert

Hello again, Micro!

I've tried several things before ask help here, but I can't get my wireless controller to work.

I'm doesn't having any response on any button or analog.

-Checked and rechecked all the connections.
-Pretty sure that all the components have their properly values, I've checked
-Pretty sure that there's no shorts, I've checked
-Controller is working normally without the wirelles circuit
-Vcc and GND isn't inverted on any place
-I'm pretty sure the microcontrollers are flashed correctly and the right fuses
-Flashed different virgins MCUs on different programs. I'm using USBASP and used Extreme Burner and MyAVRProgool. same result, nothing.
-Checked aswell the RX. No shorts, right values and right connections. The N64 also recognize the RX, so I think the issue isn't there. (?)
-The RX is on P1 mode and I pressed A while turning the controller on.
-Tried turn on the controller before the N64 and vice versa. Same result.
-Powering everything with 3.3v.

Do you have any other tips?

Thanks =)

micro

@konsolkongen: I've also had a set of the official Sega IR controllers. They feel very nice, although they're significantly thicker and the battery lids tend to open in the the heat of the battle ;) There probably won't be special version for those controllers. But if you really want to apply the mod on them then I suggest you remove all electrical components on the PCB (IC, resistors, caps, etc.). Then you can rebuild the circuit of the official wired Sega controller by using 2x 74HC153 ICs (see: http://www.gamesx.com/controldata/saturn.htm). After that you should be able to do the normal Saturn wireless mod on them, but without the voltage regulator inside the pad (no need for that).

I guess it's not really worth the effort...

@pervert: When the N64 thinks there's a controller connected then this just means the connection between the N64 and the MCU inside the receiver is ok (which is only a single wire). It's still possible you got the connection between the MCU and the nrf receiver module wrong.
I'd also try out both channels, of course.

If you really want me to spot the error you should post pics of your controller and receiver circuit. A lot of pics; good and sharp pics on which I can actually see all the details =)

Ignition365

My understanding with making a wireless n64 controller that is capable of still using a memory pak is that wireless transmission of memory data is not reliable and therefore discouraged, do you think it would be possible to integrate a memory pak into a receiver?

I think the receiver would be overly large if I were to do that, but I'm sure I could finagle something so that it rests over the actual console.

Konsolkongen

#73
Quote from: micro on June 21, 2012, 07:22:29 PM
@konsolkongen: I've also had a set of the official Sega IR controllers. They feel very nice, although they're significantly thicker and the battery lids tend to open in the the heat of the battle ;) There probably won't be special version for those controllers. But if you really want to apply the mod on them then I suggest you remove all electrical components on the PCB (IC, resistors, caps, etc.). Then you can rebuild the circuit of the official wired Sega controller by using 2x 74HC153 ICs (see: http://www.gamesx.com/controldata/saturn.htm). After that you should be able to do the normal Saturn wireless mod on them, but without the voltage regulator inside the pad (no need for that).

I guess it's not really worth the effort...

Don't say that I think it would be totally worth it :D Thank you for this information it seems very simple. I don't suppose it would be possible to make the 1P/off/2P switch work as it normally does on the infrared pads (so I wouldn't have to hold down A or B to select a channel, and put it in center for OFF) without having to mess around with your code? I could just make it on/off/on and use A and B for channel select, that would work fine, but the other way would be just a tiny bit cooler ;)

EDIT: Think it will be possible to power the 74HC153's with only 2.4V (2x rechargeable AA batteries) using some kind of voltage regulator? According to the 74HC153 schematic it requires 5V to function.

micro

@Ignition: No, I don't know how to emulate a memory pak on the receiver side.

@Konsolkongen: Just pick two 74HC153 devices (not the 74HCT153), they'll run fine on supply voltage as low as 2V.
The NRF transceiver module also works with 1.8 to 3.6V. The only problem I can think of is that 2.4V may be a little bit too low for the Attiny2313. If you run into problems you should use the ATtiny2313V version.

Konsolkongen

Quote from: micro on June 25, 2012, 12:15:53 AM
@Konsolkongen: Just pick two 74HC153 devices (not the 74HCT153), they'll run fine on supply voltage as low as 2V.
The NRF transceiver module also works with 1.8 to 3.6V. The only problem I can think of is that 2.4V may be a little bit too low for the Attiny2313. If you run into problems you should use the ATtiny2313V version.

Awesome thanks a lot. Better get go for the ATtiny2313V just to be sure :)

public-pervert

Hi Micro!

I've rechecked the connections betweeen the NRF and MCU on both controller and receiver, everything is right and no shorts.
One thing I've noticed is that the pullup resistor on the controller's data line is 7k on my multimeter, but the colors say it's 10k. Does it make any difference?
I don't have a camera anymore, just my iphone and the image quality isn't good. I don't want your eyes bleeding hahaha..
I'll take pics with my job's camera later.

I have another question:
Is possible to get the MCU "partially working"?
I remember had the error "cannot set SCK period" when programing the ATMEGA8, but the console recognizes the RX, this means the MCU is working, right?

micro

When the N64 regognizes the receiver as a controller then I'm sure flashing of the microcontroller was successful.

7k instead 0f 10k pullup resistance in the transmitter also shouldn't be a problem. Did you measure the resistance when the resistor was already soldered in the circuit? If you did so, you will not get the right value, so don't worry....

Did you also set the right fuses of the microcontroller inside the the transmitter? 8 MHz crystal and caps installed?


There's also always the possibility that one NRF transceiver module is just dead; happened to me when I got the very first batch....

public-pervert

#78
Would be really sad if one NRF's dead. I just bought 2 units and it took forever to arrive  :-[
I can't believe I'll need to wait this all again.  :'(
There's some way to test and see if it's still alive?
Also, there's some way to test if tiny 2313 is flashed right?
On the tests, I'm not using the 22pf capacitors on any clock cristals.  Does it really matter?

Also, is 3v3 voltage enough to run the MCUs at 8mhz and 16mhz?

micro

Quote from: public-pervert on June 28, 2012, 04:08:01 AM
On the tests, I'm not using the 22pf capacitors on any clock cristals.  Does it really matter?

Are you kidding? The two 22 pF caps on the 8 and 16 Mhz crystals are absolutely mandatory  :P
Why did you leave them out?