SNES (Super Nintendo Emulated System)
I wanted to use the stock SNES AC-Adapter to power the system, so I had to find out what it’s output was rated for.
According to the label, the AC Adapter is rated to provide 850mA at 10v. Nintendo is known for quality, so I trust the labeling, and accept that the wall wart could provide what it is labeled.
As the Model B Raspberry Pi runs on 5v, and could use upwards of 700mA, I needed a way to step down the voltage to 5v. Going by Ohms law, and assuming the impractical notion you could convert the voltage with 100% efficiency, you’d have 1700mA power at 5v, but we live in the real world. Actual Super Nintendos use a 7805 linear voltage regulator with heatsink to step down the voltage. While this may have been logical in 1991, and still economical today, there are MUCH better ways of doing things.
I ended up using a Murata DC-DC converter that is rated to provide up to 2 Amps of power @ 5v. According to the data sheet, it is 95% efficient when stepping down 10v. Rough math tells me 95% of the 1700mA I provided earlier gives me 1615mA to work with. To be safe, I placed a 1.5A pico fuse in the circuit, in fact, this is the same value a stock SNES uses. This is cutting it close as the Raspberry Pi typically only begins acts stable when provided with an 1A PSU, but I felt the rest of the peripherals shouldn’t drain too much current. Connecting any high-current USB devices, like a hard drive would likely trip the fuse, but I’ll be mindful not to do that. 😉
If you examine the picture above, you could see I kind of threw in the kitchen sink. A few things to note; on the bottom right corner is a Reset button I stole from an SNES motherboard. It lines up to the case’s Reset button, and will be used later. The unpopulated socket directly above it is reserved for a SuperCIC Lock. The SuperCIC emulates an original SNES CIC chip which is used to check for pirated games. Nintendo got smart later in the consoles life, and started using the “key” in some carts to scan for unauthorized copying equipment by scanning for a lock. I reserved this space as I imagine I may need it for SA-1 games.
As the Pi has no real power management, I needed a way to safely power off the system using the power switch, thus using the switch to physically disconnect the power was a huge no-no. I purchased a P-Channel MOSFET that was way over-kill, and has a nominal Gate-Source voltage of -10v, despite being marketed as being TTL controlled, but using 5v logic is fine. Basically pulling the gate low passes voltage.
The MOSFET is configured to switch power to the entire system with the exception of the power management circuit I have to monitor the switch state, and safely shut down the Pi.
The way I configured the Arduino to do this isn’t elegant, but it works given the limitations. Basically, when the file system, and really the Linux kernel shuts down, the Serial UART TX Pin that is typically a HIGH 3.3v goes low. When the user switches off the power switch, the Arduino logs in to the Serial terminal as a user, and issues a poweroff command. The Arduino then monitors the stat of the Pi’s TX pins. Once the pin goes low, and stays low, I turn off the MOSFET. The detection of this occurring is represented with the green LED in the video below..
If the Pi doesn’t safely power down after about 40 seconds, the Arduino attempts to log in as a user again, and send the poweroff command one last time. If the Pi doesn’t power down about 30 seconds after this, the Arduino kills the power anyway, as life goes on, right?
Connected to the Power Management circuit of things powered all the time is an 74HCT125N chip used to step up the Clock and Latch lines used by both SNES controllers from 3.3v to the 5v logic that they need. It also steps up the Pi’s TX pin that connects to the Arduino. While the Arduino will accept 3.3v as logic high, the chip is there, so why not use it? Also connected is a 74LVC245AN chip needed to step down the SNES controllers 5v Data pin logic to something that won’t damage the Pi. It also steps down the ATMega’s TX pin used to log into the computer.
I kept both chips powered at all times as there is a feature to hold their I/O lines in high impedance, and I didn’t want to have the chips powered off in an environment of a mixed power state. I could probably rethink this, but it works for now.
Next up, setting up the I2C bus, and SNESDev-Pi controller driver..
Oh my god. I LOVE that! How awesome to play anything emulated on the original hardware. Plus carts!
Pingback: Turning a Raspberry Pi into an SNES | Daily IT News on it news..it news..
Congrats for that neat project!
Might be a silly question (as questions usually are) but assuming someone who can write / edit / hack, would it be possible to address the speed issues by throwing two Pi’s in the box, one to handle the graphics, the other to handle sound and other I/O rather than waiting for a faster PI?
Very nice project, congratulations!
I still have two SNES in perfect working condition 🙂 They are bullet proof console!
Can you post the wiring you did for this? Rather than just showing off? 😛 JK man, very cool
Andy, I have actually considered something along those lines. I hadn’t considered offloading audio and I/O to a second Pi, I had just imagined spitting the threads, but your suggestion sounds better. Thanks for the tip! 😀
I’m not exactly sure how I would pull it off though. I could link both Pis via GPIO, or Ethernet. I’m guessing GPIO communications would be the best, but I lack the skills needed for re-coding major portions of the emulator.
Shake, there are no schematics. I wired the level shifters by the datasheets, and actually screwed up a few times due to the fact I was wiring on a whim.
As for the other components, the Arduino sketch has the pin numbers for power management, and the cart_reader.py script could clue you in to what cart pins go where. Also because you asked, I appended a spreadsheet I used for the cart to my GIT. 🙂
Why is not in fullscreen?
This is very interesting, but I must find a broken SNES console and buy another Pi (my only one is in use).
Very awesome project, congratulations.
You win 1 Internet Sir. Well done!!!!!!
Would it be possible to release a fast snes emulator which we can use with the RasPi? Every snes emulator I tried was very slow.
The cart reader aspect is pretty awesome!
>> offloading audio
Maybe a USB soundcard with its own processor might be able to help.
I’m just about to start doing the same thing as you yet to buy the raspberry Pi but got the broken snes lol 🙂 now who still got me soldering Iron lol
You are a god amongst men Ted. Awesome project. Well done.
Hey! I could have sworn I’ve been to this site before but
after checking through some of the post I realized it’s new to me.
Anyhow, I’m definitely delighted I found it and I’ll be book-marking and checking
back frequently!
Hey I’m working on a similar project but my work is nothing compared to yours nice work.
Hey! Nice job! Is it possible that you publish the material list and the solder layout. I realy love to reproduce this ’cause my old SNES start to bug :/.
Excellent site you have here but I was wanting to know if you knew of any forums
that cover the same topics discussed in this article?
I’d really like to be a part of community where I can get feedback from
other knowledgeable people that share the same interest.
If you have any suggestions, please let me know. Thanks a
lot!
Feel free to visit my web blog http://www.huishige.com
Hey just wanted to give you a quick heads up and let you know a few of the images
aren’t loading properly. I’m not sure why but I
think its a linking issue. I’ve tried it in two different
browsers and both show the same results.
Another interesting project would be to put an raspberry pi in a snes cartridge which emulates an snes game on the cartridge pins. That would make it possible to play any rom with the original untouched snes 🙂 that would also make it possible to play custom roms, to build a simple web browser or an mdp client and much more, everything with the original untouched snes hardware 🙂 And who knows what you could do with the snes when you extend the snes with the 16 Bus B Expansion Chip Pins (or the ext port) and the help of the raspberry pi..
Pingback: 5 Old School Gadgets You Can Create With a Raspberry Pi | Retro Gamer
Pingback: 5 Old School Gadgets You Can Create With a Raspberry Pi | Retro Bunny
Hello. I really admire your work. Congratulations.
I wanted to run Gameboy & Gameboy color cartridges with the Raspberry Pi 3B.
Do you believe to be possible? Basing their work believed to be viable?
Can you clarify some doubts if I need it?
Thank you very much.