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

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

Previous topic - Next topic

micro

Quote from: niceguy on April 22, 2014, 02:52:41 PMOk I change my probe setting and now I get the clock on the receiver like you demonstrated. I plugged the receiver into my saturn and booted with vampire savior, a game which only high lights versus if a controller is plugged in player 2 and after which player 2 was detected when I plugged in the receiver. I am still not sure if this detection is simply however basically pin 6 at 5 volts or does this detection actually involves the MCU.
No, the game actually reads the controller. You can try to unplug the crystal and you'll see it won't longer detect your receiver as a controller.


Quote from: niceguy on April 22, 2014, 02:52:41 PM
Where do those two lines go on the transmitter then if they do not go where your schematic is telling me to put them, can you clarify.
...
The TX now is my focus. I am not sure how you want me to wire the MISO and MOSI since your schematic is telling me two things. Right now I have Mosi at pin 18 of the attiny and Miso at pin 17 of the attiny
The schematic is correct of course. The fact that the "MOSI" line connects to the Attiny pin that's labeled as "MISO", and vice versa, has led to confusion in the past. But the way you connected it is correct.


Quote from: niceguy on April 22, 2014, 02:52:41 PMAlso following your instructions to place the pad VCC on pin 11 of the attiny, when measured I get milivolts at best
Yes, because the MCU switches off the controller PCB most of the time in order to save power. If you connect your oscilloscope you should see that the controller is powered on only for a very short time (maybe 100 us, enough to read the button states) with a frequency of about 60 Hz. So yes, the mean value of SAT_VCC should be in the mV range.


Since you got an oscilloscope you can tap the NRF's IRQ lines on the transmitting and receiving circuit. On the receiving side IRQ should go low if it has received a package. On the transmitting circuit IRQ goes low after sending a package (no matter if sending was successful or not). So you should be able to resolve your issues soon.

If you can't find the solution, you can post some pics of your setup and wiring.


PS: Also keep in mind you have to choose the same channel for the receiver and the transmitter.
PPS: Yes, it's a cheap Rigol DSO. I'm just a poor student  ;D



niceguy

Quote from: micro on April 22, 2014, 06:30:09 PM
Quote from: niceguy on April 22, 2014, 02:52:41 PMOk I change my probe setting and now I get the clock on the receiver like you demonstrated. I plugged the receiver into my saturn and booted with vampire savior, a game which only high lights versus if a controller is plugged in player 2 and after which player 2 was detected when I plugged in the receiver. I am still not sure if this detection is simply however basically pin 6 at 5 volts or does this detection actually involves the MCU.
No, the game actually reads the controller. You can try to unplug the crystal and you'll see it won't longer detect your receiver as a controller.


Quote from: niceguy on April 22, 2014, 02:52:41 PM
Where do those two lines go on the transmitter then if they do not go where your schematic is telling me to put them, can you clarify.
...
The TX now is my focus. I am not sure how you want me to wire the MISO and MOSI since your schematic is telling me two things. Right now I have Mosi at pin 18 of the attiny and Miso at pin 17 of the attiny
The schematic is correct of course. The fact that the "MOSI" line connects to the Attiny pin that's labeled as "MISO", and vice versa, has led to confusion in the past. But the way you connected it is correct.


Quote from: niceguy on April 22, 2014, 02:52:41 PMAlso following your instructions to place the pad VCC on pin 11 of the attiny, when measured I get milivolts at best
Yes, because the MCU switches off the controller PCB most of the time in order to save power. If you connect your oscilloscope you should see that the controller is powered on only for a very short time (maybe 100 us, enough to read the button states) with a frequency of about 60 Hz. So yes, the mean value of SAT_VCC should be in the mV range.


Since you got an oscilloscope you can tap the NRF's IRQ lines on the transmitting and receiving circuit. On the receiving side IRQ should go low if it has received a package. On the transmitting circuit IRQ goes low after sending a package (no matter if sending was successful or not). So you should be able to resolve your issues soon.

If you can't find the solution, you can post some pics of your setup and wiring.


PS: Also keep in mind you have to choose the same channel for the receiver and the transmitter.
PPS: Yes, it's a cheap Rigol DSO. I'm just a poor student  ;D

Quick question the wireless controller will work at the dashboard/ CD player screen correct

Also since my transmitter is still on my breadboard I am running the Attiny at 5 volts and of course the transceiver is regulated at 3V. I know the attiny is well within operating voltage on its spec sheet but is it cool to use 5 volts with your design on my breadboard.

I will scope the IRQ lines when I get home and do a one shot trigger on pin 11 so I can see the controller power up as you described here

I have pin 2 that handle the channel select open on my RX and on my TX I hold down A when I power up. Now when you say open is pin 2 on the RX just floating not connected to anything because I can see when you select channel 2 you are shorting pin 2 to ground.


Btw Rigols are real good DSO, I went with a  portable Siglent because I need the mobility. Rigols usually run $400 so I would not call that cheap if your the average hobbyist, I mean who can afford a TEK or Agilent with comparable features.




EDIT

OK FINALLY gotten it working. Here was my problem. I have two saturns, my favorite and primary unit that I modified with a region switch has given me zero problems over the years despite that I bought it second hand. It plays disks the first time every time and the expansion slot works the first insert every time also.  I decided to reward its faithful service by not working it so hard and placed it on standby.

My back up Saturn which I bought brand new and have very very very rarely used is demonic. This unit has less than 19 hours of play time and has been gently stored and maintained but despite this the unit is a broken down POS because it rarely recognizes disk and god help me if I need to use the expansion port for my 4meg action replay because it will not see the cart 99.99% of the time. I literally have to manually spin the disk on this damn thing to get it going. It's virtually a brand new Saturn.

Guess which unit I was originally testing the wireless controller with. Well I got out my old trusty primary Saturn with its controller. Remember I commented on not seeing voltage on pin 11 of the TX, well I plugged in the controller from my primary saturn and up pops my 4.5 volts. I proceeded to plug the RX into my primary saturn and power up both the TX and RX and bam I had COM

I am happy I got the controller working but feel bummed that I bought a faulty Saturn and didn't find out until 16 years later. The damn thing did not give me these problems when I did a 19 hour test play all those years back. Scary thing is I ALWAYS buy back up systems when the next Gen comes out. I have a back up Nes, Snes, Genesis, Dreamcast, PSone, PS2, etc and now I am paranoid.

Well I would like to thank you man for the controller and the help you have given me here, thank you very much

BTW I would like to ask you a technical issue relating to this project over pm


borjaus

Hi micro,
Is there any possibility to add a LED N64_RX scheme to indicate when the knob is turned on?
Can I get added to the scheme N64_TX Voltage Regulator TO-92 with the necessary components?

abduct

Quote from: borjaus on April 29, 2014, 10:19:33 PM
Hi micro,
Is there any possibility to add a LED N64_RX scheme to indicate when the knob is turned on?
Can I get added to the scheme N64_TX Voltage Regulator TO-92 with the necessary components?

The RX module is powered by the console so I am not sure why you would need a power led as the only time it would be turned on is when the console is on. Although if you much rather have one you could take a resistor and led and add it in parallel to the VCC coming in to the ground.

borjaus

Thanks for the reply.
I do not want an LED lights up in the RX module when the console is turned on.
I want a LED on the RX module to turn on when you turn on the pad, to know that the pad has been synchronized with the console.

I do not know if I explained it well   :-\
Sorry for my English

abduct

Quote from: borjaus on May 04, 2014, 02:01:47 AM
Thanks for the reply.
I do not want an LED lights up in the RX module when the console is turned on.
I want a LED on the RX module to turn on when you turn on the pad, to know that the pad has been synchronized with the console.

I do not know if I explained it well   :-\
Sorry for my English

Ah I understand now. Unfortunately I do not think micro works on this project any more since he has a new version being created and I am in the process for organizing, cleaning, and porting his code to a new chip (at least after i fix my breadboards again) so I wont be able to add this either.

jacobsson

Quote from: micro on April 22, 2014, 06:30:09 PM

Hi Micro, hands down the coolest wireless project around!
I'm definitely gonna sink my teeth into to this asap.
May I ask where you found those nice looking plastic enclosures for the receivers?
Thanks for this!



borjaus

Can I be diodes indicate that model are these?

I guess they are to program the chip without having to remove the battery, is this correct?


micro

These are just the 3 wires connected to the N64 controller PCB: data, Vcc and ground (also labeled on the white sticker :D)

The black 6-pin ISP socket in the top left corner is used to program the microcontroller.

borjaus

Sorry but I think you understand me.

I want to know reference diodes and what is its function.


kendrick

In the image bourjaus references, three dark items on the perfboard are attached to the wiring for the controller. He assumes that these are diodes, but I believe that micro identifies them just as wiring connectors. Is that about the size of the problem here?

micro

Ok, if that was his question then you're right: This is just a (trimmed down) pin header to solder the wires to.

jss_josafa

Micro Hello! First I have to congratulate for your wonderful work of wireless controllers, very professional.
I have all the parts ordered and mounted it on a breadboard just not nothing worked, now mounted and dismounted used other NRF24L01 + thinking they would be in trouble but still did not work neither.
I'm using the voltage regulator L78L33 not know if this would be a problem, and also used a universal AVR Recorder G540. And I'm also using an NTSC SNES control that is where my doubt, because only saw the designs with the SNES Pal control.
Control is compatible with NTSC SNES this project?
Could you help me?

My name is: Josafá
I live in Brazil and do not speak or write English, I'm using google translator, sorry for the mistakes.
A hug and congratulations for this great project.

eitnot

Quote from: abduct on February 01, 2014, 04:19:03 PM
Quote from: sazyario on February 01, 2014, 02:18:29 PM
How is version 2 coming of this project?

If you are referring to the official "version 2" you can check Micros progress in this thread below. Last I heard I believe he was working on a sega version of his controller.

http://nfggames.com/forum2/index.php?topic=5180.0

If you are referring to my branch off I stated I was doing, I have yet to really start. Parts from china have been delayed due to their holidays, but hopefully they should arrive early next week. I'm just waiting on my linear voltage power supplies for my new breadboards. Once those come in I will be able to officially start the project. I've already have all the parts/sourced other parts needed to complete this after the reprogramming is done. When I get something solid functioning I'll make a dedicated thread for it.

Hey Abduct,

How are things going with your branch?  I was wondering what all you plan on supporting with your branch?  Any chance you'd be adding PS2 controller support?  Just curious.

abduct

Quote from: eitnot on June 10, 2014, 09:19:36 AM
Hey Abduct,

How are things going with your branch?  I was wondering what all you plan on supporting with your branch?  Any chance you'd be adding PS2 controller support?  Just curious.

I've been a bit busy lately and haven't had much time to work on them unfortunately. They are still laying on the breadboard next to my game systems. As for ps2 controller support I am not sure. I never thought about the newer gen consoles since they already had wireless controllers made for them when they were released. I am still in the process of porting the code to a new AVR micro controller and cleaning it up a bit. As for support, it will support mostly everything that is already supported as I'd just need to change the code around, but as for other systems I would have to dig my consoles out and look at them. As of right now my branch only supports N64 as that's the only console that's not in storage. Once I am done with other projects I will pick this one back up I have quite a few people interested in it on my IRC and forums.

eitnot

The main reason I was asking about PS2 controller support is because right now I just have the Logitech wireless controllers for PS2 which I prefer the Sony PS2 controllers.  The other reason is they already have PS2 to USB adapters that work with PC and PS3 so then we could use the all controllers easily with those systems.

abduct

Quote from: eitnot on June 11, 2014, 12:06:09 PM
The main reason I was asking about PS2 controller support is because right now I just have the Logitech wireless controllers for PS2 which I prefer the Sony PS2 controllers.  The other reason is they already have PS2 to USB adapters that work with PC and PS3 so then we could use the all controllers easily with those systems.

Yea I may look into it. I have a china clone logic analyzer on the way to help me debug my current units, because last time I used my breadboards with the prototypes for N64 it was working until I moved lab locations and now they do not want to work. I did a quick google search and there seems to be allot of information on the ps2 controller protocol so it would just be a question of how long it would take to bang out some code after I get the other consoles working.

I'm planning on moving to a smaller soic chip and actually making this as small as possible with a mod chip style hookup where you solder your wires to a printed and/or etched pcb then to specific points on the console/controller. I can't remember all the features I was going to build into it but the general idea was to make it small and easy to hook up by way of soldering the wires according to which console you were modding and flashing the proper image to the soic chip via a built in ISP port.

mikedan435

Do you think you will ever sell a kit with all of the parts included?

abduct

Quote from: mikedan435 on June 15, 2014, 08:23:05 AM
Do you think you will ever sell a kit with all of the parts included?

Maybe, but I doubt it. Selling hardware is always risky when selling to the general public and the risk of losing money or barely breaking even is to high. Plus this is micros original work I would not be comfortable selling it without his permission anyways being that I am doing practically minimal changes when compared to the work hes done.

I would be doing the same thing that he has done though as per detailing its construction and providing a bill of materials with ebay links for more uncommon parts.

I'd love to fully port this project to C though but most of these protocols timings are so tight that I'd either have to use a really fast chip, or hand optimize the code which is no better then writing it in assembler.

DNSDies

Micro,

I've been trying to make your wireless controller for my NES, and while I think I've made the Transmitter and Receiver perfectly, they don't seem to work.
Upon further inspection, I accidentally installed the voltage regulator for the receiver backwards, supplying it with 5V.
I also managed to use only a 1.2K Ohm resistor on Pin 1 (reset) of the ATMega8.

Did I bork my NRF24L01, and did I wipe the programming on my ATMega8?

Also, is there a simple way to test the NRF24L01's before placing them?
Like, say, just a simple diagram and arduino program that connects 2 transceivers and makes them cause two LEDs to blink to show that they are, in fact, able to send and receive.

micro

To me it seems the NRF transceivers are very sensitive and easy to kill if they're supllied with the wrong voltage.

Actually there's a way to see if the RF link is working. You can measure the IRQ's voltage. If there's traffic the  voltage should drop a little bit. It's already mentioned some pages ago. :)

Rafaeldalmolin

Hi, okay?
I have been following your project and liked.
Did a good job with the pcb board that is so cool.
then, I'll try to follow your tutorial and make my propio wireless controller, however I'm with some doubts of some components, I got almost all but before buying them, wanted to know if he can take some doubts about which models Microcontrollers:

Atmega8: http://www.dx.com/pt/p/maitech-avr-microcontroller-atmega8-16pu-dip-28-black-303582#.U7zrSfldVyU
Attiny : http://pt.aliexpress.com/item/ATTINY2313-20PU-IC-MCU-AVR-2K-FLASH-20DIP-ATTINY2313-20PU-2313-ATTINY2313-Y2313-NY2313/1875093248.html

About regulator voltegem one of 3.3 V work?
Or I would end my transceiver .... The question may sound stupid, but do not have much knowledge in the area, but if you could help me in doubt.
I am grateful.

Appl3Kork

micro: I know you've probably been asked this a thousand times, but I'm interested in the mod for the N64 Controller.  I can probably do the controller part, but the whole other process in the rumble pack, not so much...  Would you be willing to sell one of those pre-built?  I know that people would think "Oh it's too expensive to send something like this." But I'm really interested, and willing to pay for one!

Let me know!

Thanks!

DNSDies

So, I went and designed a board in Eagle, and has it fabbed at OshPark, and made a wireless receiver and transmitter for my NES, and I just have to say...

This is really terrible.
The range is flipping horrible.

It has a range of about 2-3 feet, and seems to be dropping packets constantly.

Maybe I'm doing something wrong?

---EDIT---
Upon further investigation and testing, it looks like some NRF modules might not be pulling sufficient current to drive themselves, so I popped a 4.7uf capacitor between the VCC and GND pins on the module, and the range of the module doubled.
So, if anyone else has the problem, try it out.
I'm gonna try a 47uf cap next.

public-pervert

Almost sure you did a poor work or badly positioned it inside the controller. Maybe covering it with your hands, or just don't have the skills to make one yourself.

All my controllers are great and have great range. Never noticed a bad NFR module.

DNSDies

I was using the older green NRF module, and "skill" isn't the issue.
I tried both a hand-wired version and also designed a board in Eagle to fit everything, and I STILL had range issues. I'm thinking it's interference or something.

I've designed another board that acts as a drop-in replacement for an NES board, where you can desolder the NES 4021 CMOS 8-bit Shift Register, drop it in the board, and populate it with the ATTiny*p*, some through-hole resistors and capacitors, and wire the battery, LED, and switch in the appropriate places and it should have a sufficient ground plane and filtering to block most radio interference.


gr1n_reap3r

@Micro

need help here. I have program a ATMega 88A -pu with  N64RX2.hex file using "USBASP" programmer and Khazama AVR Programmer. But im not sure if it was successful. It gives me one error message saying "Error Setting USBASP ISP Clock" follow after a messages saying "Reload FLASH file: C:\...\N64_RX\N64_RX2.hex" "Last EEPROM file not found" "Erasing..." "Writing FLASH...". Well after that I click read chip and the hex file is present or at least the program im running say it is.

I tried using Myavr but after selecting "USBASP" as programmer it ask for port but I do not know what place there. And if i leave it blank i get an error when attempting to flash .hex file on to chip or read chip. My programmer work when i used BASCOM to flash a bas file on another chip for the n64 joystick mod but haven't been able to do anything when it comes to flashing  .hex files with the other programs.

public-pervert

Almost sure you can't use Micro's HEX with an ATMEGA88, someone correct me if I'm wrong.
Once you set the fuses, you aren't able to reflash the chip without the crystal. Try flashing it with the crystal soldered on.

gr1n_reap3r

Quote from: public-pervert on August 07, 2014, 06:34:58 AM
Almost sure you can't use Micro's HEX with an ATMEGA88, someone correct me if I'm wrong.
Once you set the fuses, you aren't able to reflash the chip without the crystal. Try flashing it with the crystal soldered on.

In the txt file for the n64rx he listed Atmega88 as one of the components."see update 2" And my real problem right now is the softwares he list in hes pdf file, don't work by default with a USBASP. I'm trying to get MYavr to work with my USBASP since it list under other under hardware, but i can figure out what to put in the box that says connection.

http://i1369.photobucket.com/albums/ag225/gr1nreap3r/MCU/myavrpic01_zps5d1e7146.png

Update: I figured out how to set the fuses using the other software "Khazama Avr".

Update2: Miss read it. I see now it says ATMega8 not 88. Now i got the figure out how to get a ATmega8, I really don't want to pay $7usd for shipping for 1 microcontroller

micro

@DNSDies: Nice work! But I don't think it pays off to make a PCB for v1...

@gr1n_reap3r: I've also got a USBasp programmer now. I can use it with myAVR Progtool, here are my settings:



But you definitely need the appropriate drivers to use the programmers. You can also use eXtreme Burner AVR: http://extremeelectronics.co.in/
I think eXtreme Burner comes with the right drivers. After the installation you should be able to use the programmer with myAVR Progtool too.

Sometimes I get errors in both programs if I want to read or flash a microcontroller. Just try it again, usually it will work.


gr1n_reap3r

#354
Quote from: micro on August 07, 2014, 09:15:08 AM
@gr1n_reap3r: I've also got a USBasp programmer now. I can use it with myAVR Progtool, here are my settings:



But you definitely need the appropriate drivers to use the programmers. You can also use eXtreme Burner AVR: http://extremeelectronics.co.in/
I think eXtreme Burner comes with the right drivers. After the installation you should be able to use the programmer with myAVR Progtool too.

Sometimes I get errors in both programs if I want to read or flash a microcontroller. Just try it again, usually it will work.
@micro
Alright thanks! I'll try your settings and also give eXtreme Burner AVR a tried. I'll post an update later with results.

Update: Alright some great news. I tested both eXtreme Burner AVR, and Myavr(after eXtreme Burner AVR) with my only chip left which is the ATTiny2313. And it works!!!! So i can go ahead and continue with the transmitter part. Until i can get a hold of ATMega8, the receiver will be on hold. Thanks micro!!!

DNSDies

Quote from: micro on August 07, 2014, 09:15:08 AM
@DNSDies: Nice work! But I don't think it pays off to make a PCB for v1...

If you'd provide a block diagram for V2, I'd gladly provide you with the Eagle Files for the NES PCB. could save you the time of measuring it all out by hand.
My PCB also has that little cutout on the right for a large charge plug too.
I'm also working on a drop-in replacement PCB for the Sega Saturn, trying to use only the middle section of the V1 controller.

What are some of the differences in V2?

micro

@gr1n_reap3r: I'm glad it worked! :D

@DNSDies: Thanks, but I want to design the v2 PCB's myself. I also don't want to use large charge jacks but standard mini USB sockets. And everything should be soldered to the PCB, no dangling wires except for the battery of course.

Some differences/improvements of v2 over v1 are:

- 10 instead of 2 selectable RF channels
- no on/off switch, turning on the controller is done by pressing the Start button
- auto turn off after 5 minutes of inactivity
- lower current consumption while active (about 1 mA) ==> extremely long battery life
- most important: much more robust and reliable RF protocol

public-pervert

Quote from: micro on August 10, 2014, 03:17:27 AM
Some differences/improvements of v2 over v1 are:

- 10 instead of 2 selectable RF channels
- no on/off switch, turning on the controller is done by pressing the Start button
- auto turn off after 5 minutes of inactivity
- lower current consumption while active (about 1 mA) ==> extremely long battery life
- most important: much more robust and reliable RF protocol

Really looking forward to this, dude!  ;D

DNSDies

Quote from: micro on August 10, 2014, 03:17:27 AM
- 10 instead of 2 selectable RF channels
- no on/off switch, turning on the controller is done by pressing the Start button
- auto turn off after 5 minutes of inactivity
- lower current consumption while active (about 1 mA) ==> extremely long battery life
- most important: much more robust and reliable RF protocol

So, most of these changes are software based.
Will you be able to provide updated Hex files for people who have made these V1 board already so we can re-flash them to take advantage of the better RF protocol?

public-pervert

I don't think it's just an improvement on the FW. Micro already said it's a completely different hardware too.