It is currently Mon Sep 16, 2019 7:44 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Mar 25, 2015 12:00 pm 
Offline

Joined: Wed Aug 21, 2013 8:44 pm
Posts: 13
For the last couple of weeks I've been thinking about how to do wireless controllers for NES and SNES.

I've looked at Arduino, IR, RF, etc and I've seen a couple of projects that involved either hacking up an existing controller or creating new controller from the ground up. Instead of trying to reinvent the wheel I looked at as many existing solutions that I could find and tried to see if they could be applied in new ways.

Looking at ebay and amazon I can see that there's all kinds of NES/SNES bluetooth controllers that seem pretty nice. Why not just use one of them.

Here's the idea...

1. Get a Raspberry Pi
2. Connect a RPi supported bluetooth dongle
3. Install this https://github.com/SonnyJim/snesbot on the RPi OS
4. Get an old NES/SNES plug + cable and connect to the RPi to get Power from the NES/SNES and to send instructions to the NES/SNES
5. Pair a bluetooth controller with the RPi

It might take some modification of https://github.com/SonnyJim/snesbot to accept input from the bluetooth controller. But, when implemented this should allow users to use any bluetooth controller with an actual NES/SNES.

Please let me know what you think. I'm writing it here to get the idea out if I get too lazy to implement.


Top
 Profile  
 
PostPosted: Wed Mar 25, 2015 12:17 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8559
Location: Seattle
Since the NES/SNES protocol is roughly half-duplex SPI, it should be feasible to use the RPi's native SPI hardware rather than rely on external 4021s. (the latter is what snesbot did).

It should be easy to extend snesbot to serve as a USB/BT mouse->SNES adapter too.


Top
 Profile  
 
PostPosted: Wed Mar 25, 2015 3:49 pm 
Offline

Joined: Wed Aug 21, 2013 8:44 pm
Posts: 13
Ahh, I didn't see that snesbot used external chips until I looked at the schematic.

Anybody know why snesbot was designed this way? Instead of wiring from the Raspberry PI GPIO to the SNES input port directly and calculating everything in software?

Image


Top
 Profile  
 
PostPosted: Wed Mar 25, 2015 3:52 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8559
Location: Seattle
He said that the RasPi couldn't keep up with the SNES automatic polling speed.

And the reason he didn't use the RasPi SPI hardware is because apparently the RasPi SPI hardware is master-only (laaaame)


Top
 Profile  
 
PostPosted: Wed Mar 25, 2015 4:17 pm 
Offline

Joined: Wed Aug 21, 2013 8:44 pm
Posts: 13
Wow :-) thank you for the quick feedback.


Top
 Profile  
 
PostPosted: Thu Mar 26, 2015 7:22 am 
Offline

Joined: Tue May 05, 2009 8:44 pm
Posts: 71
I personaly have done a Wireless Snes Controller base on that project:
http://nfggames.com/forum2/index.php?topic=4393.0


Top
 Profile  
 
PostPosted: Thu Mar 26, 2015 8:11 am 
Offline

Joined: Wed Aug 21, 2013 8:44 pm
Posts: 13
That is a great project but it's the one I was referring to when I said "Hacking up an existing controller" initially.

- The advantage of using bluetooth is there's 1000's of controllers already available. Some are very high quality.
- The advantage of using the raspberry pi is that it's cheap, and runs linux (which has a full bluetooth software implementation).

It's too bad that there's some limitations that don't allow the raspberry pi to do all the processing. Maybe this will be addressed in a future revision. Using what's available now it wouldn't be that hard to create some boards for the 4021's that just plugged in.


Top
 Profile  
 
PostPosted: Thu Mar 26, 2015 9:02 am 
Offline

Joined: Tue May 05, 2009 8:44 pm
Posts: 71
Don't you think that a Raspberry Pi is a bit bulky and overkill ? The receiver I did on mine is like 6 time smaller than a Raspberry Pi.


Top
 Profile  
 
PostPosted: Thu Mar 26, 2015 9:38 am 
Offline

Joined: Wed Aug 21, 2013 8:44 pm
Posts: 13
True, the receiver likely would be larger than what you've created.

The advantage of doing things this way is you can use ANY bluetooth controller, keyboard, mouse, etc with the receiver. Because of emulators there's all kinds of bluetooth hardware available.

You could also likely hide the raspberry pi in the NES/SNES case with an on/off switch + allowing the default controller ports to work with wired controllers when not enabled.


Top
 Profile  
 
PostPosted: Thu Mar 26, 2015 11:01 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8559
Location: Seattle
I suppose it's worth pointing out that the RasPi uses more power (from the wall) than the rest of the NES...

But meh, do what makes you happy. $25 for a RasPi A+ and a few shift registers is going to be hard to beat, especially in single quantity. Unfortunately, even the + series only has 30 GPIO, so mouse emulation would require a different hat than controller emulation. (or a 4PDT switch)


Top
 Profile  
 
PostPosted: Thu Mar 26, 2015 11:48 am 
Offline

Joined: Wed Aug 21, 2013 8:44 pm
Posts: 13
I thought on the NES power is converted to DC and lowered to 5 volts.

According to this link http://www.raspberrypi.org/forums/viewt ... 28&t=17492 anywhere from 3.3 to 5.25 volts can power the RPi depending on how it's used.


Top
 Profile  
 
PostPosted: Thu Mar 26, 2015 11:57 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8559
Location: Seattle
Power is watts, Voltage is volts. Voltage multiplied by current is power. Not the same thing at all.

NES uses about 350mA at 5V; the losses in the 7805 are large but we'll ignore that (because that's the same kind of design fix as the RasPi B to B+ using a switching regulator instead of a linear one).
Random sources imply the B uses about 400mA at 5V. I guess I exaggerated a little; the revised B+ and A+ would use less power (~230mA@5V, 130mA@5V) than the NES.


Top
 Profile  
 
PostPosted: Thu Mar 26, 2015 12:12 pm 
Offline

Joined: Wed Aug 21, 2013 8:44 pm
Posts: 13
Double thank you for all the clear feedback.


Top
 Profile  
 
PostPosted: Thu Apr 02, 2015 12:58 pm 
Offline

Joined: Wed Aug 21, 2013 8:44 pm
Posts: 13
Here's another way to do it with an Arduino.

- The benefit of this technique is that you don't need to use level converters between the 4021/4021's and Arduino like you do with the Raspberry Pi.
- The downside of this technique is you don't get all the linux open source bluetooth hardware compatibility out of the box.

http://www.instructables.com/id/Control-your-NES-by-motion/?ALLSTEPS

The schematic...

Image

Here's some sample source that bluetooth could be added into... (I don't know why all dpad possibilities weren't added in)

#include <SoftwareSerial.h>
SoftwareSerial softSerial(4, 11); //RX is on pin 4
int incomingByte = 5;
int A = 8;
int left = 2;
int right = 3;
int start = 7;
void setup() {
softSerial.begin(9600);
pinMode(A, OUTPUT);
digitalWrite(A, HIGH); //buttons are active low
pinMode(right, OUTPUT);
digitalWrite(right, HIGH);
pinMode(left, OUTPUT);
digitalWrite(left, HIGH);
pinMode(start,OUTPUT);
digitalWrite(start,HIGH);
}

void loop() {
if (softSerial.available()) {
incomingByte = softSerial.read();
if (incomingByte == 0) {
digitalWrite(A, LOW);
delay(500); //The A button needs a slight delay otherwise it won't be detected by the NES
digitalWrite(A, HIGH);
}
if (incomingByte == 1) {
digitalWrite(left, HIGH);
digitalWrite(right, LOW);
}
if (incomingByte == 2) {
digitalWrite(right, HIGH);
digitalWrite(left, HIGH);
}
if (incomingByte == 3) {
digitalWrite(right, HIGH);
digitalWrite(left, LOW);
}
if (incomingByte == 4) {
digitalWrite(start, LOW);
delay(200); //Same goes for the start button
digitalWrite(start, HIGH);
}
}
}


Top
 Profile  
 
PostPosted: Fri Apr 24, 2015 6:28 am 
Offline

Joined: Tue May 05, 2009 8:44 pm
Posts: 71
Well just look at that: http://www.8bitdo.com/

Don't know if they will make a bluetooth receive for the actual consoles one day. Maybe the arduino bluetooth sketch poste above would work with those controller.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group