SNESDev-RPi: A SNES-Adapter for the Raspberry Pi

You already might have heard of the Raspberry Pi. It is a credit-card sized PC from the Raspberry Pi Foundation and is going into mass production and distribution these days. There is a huge demand for “the Pi” and the first orders are limited to one per person. A few weeks ago I got my Pi delivered and started working on what I would describe as “universal console”. In this post I describe my initial thoughts about this project and present an adapter that allows you to use SNES controllers as input devices for the Raspberry Pi.

UPDATE: The RetroPie GPIO Adapter is now available and provides an easy and safe way for connecting NES and SNES controllers to the RPi!

Being part of the 80ies generation I belong to the group of people that grew up with a whole bunch of 8- and 16-bit video consoles. Nowadays, you can find emulators for all kinds of these consoles and some time ago I got the idea that it would be nice to have a tiny PC that could just be switched on to play this or that good old game. When I read about the Raspberry I finally decided to start this project.

There are several things that have to be done for this:

  • Decide for a stable working Linux distribution that provides access to the video and sound hardware.
  • Make the emulator(s) work.
  • Build a launch menu that allows for selecting the console and or the video game.
  • Build a hardware controller interface that allows you to connect real video game controllers.
  • Build a case that contains the Raspberry and the connector(s) for the controller(s).

I know that you are now saying “Each of these five points is a project on its own.” and I agree! Let’s have a brief look at each of these points now:

The distribution The decision for a “good” distribution is tricky and I am not sure which of the available ones is best suited. Since the Debian distro will be the official distribution of the Raspberry, I think that this might be the best choice. But, currently, even the Debian distro provides an ALSA module only in alpha stage. This produces horrible audio outputs and leads us to the second point:

The emulators There is already work going on for tht point and ToadKing is doing fantastic work here. He is adapting the RetroArch emulator to the Raspberry currently and provides a public Github repository. There is also a thread about this work in the official forum. This is a central piece of this “universal console” and I really hope that the Raspberry port of RetroArch and of the emulator cores will be further developed.

The launch menu Maybe there already exists a launcher that can be compiled on the Raspberry. If you know such a thing, please tell me! Otherwise, I thought of a rudimentary (Python?) script that could be used for the beginning. Update: In the meantime, the front end “Emulation Station” has started to be developed. A lot of ideas are still being discussed and on the to-do list, but there is already a running version of it. A follow-up article presents the RetroPie setup script that automates the installation of emulators and front end.

The controller interface I think that an authentic retro-gaming device needs authentic input hardware. The Raspberry comes with two USB ports and one possibility would be to use some remakes of, for example, SNES controllers with USB connectors. In order to use original controllers, however, one needs to come up with an interface for these controllers. This is where the second part of this post comes into play: I built an adapter board that allows you to connect two SNES connectors to the GPIO pins of the Raspberry. I got the SNES connectors from two controller extension cables. This wiki article gives some more details about the GPIO pins of the Rasperry. A short C program reads the states of the two controllers and passes all button presses to a virtual keyboard that is implemented with the help of the uinput module. In the following, I explain some more details of this adapter, show some pictures of it, and, at the end, also a video demo.

Let us first talk about the hardware part. The idea of designing a PCB that could be used for connecting SNES controllers to a microcontroller or PC came up when I read about a project, in which an NES controller was connected to an iPad. In previous posts, I wrote about the first prototype, the SNES-adapter PCB, and a case for the adapter. For the connection to the Raspberry I used the following parts:

  • 1x SNES-adapter PCB
  • 2x SNES connectors (obtained from extension cables)
  • 2x Shrouded Pin Header, 2×3 pins
  • 2x Ribbon Crimp Connector, 2×3 pins
  • Ribbon Cable – 6 wire
  • 1x Ribbon Crimp Connector, 2×13 pins
  • Ribbon Cable – 26 wire

The SNES-adapter board really does nothing but to provide a clean wiring for the connectors. You could also connect a SNES connector with the 26-wire ribbon cable directly. Besides the cleaner look, the nice thing of the adapter board is that it provides the possibility to connect two controllers without the need for manually splitting the 5V line. If you are interested in the adapter board, send me a mail, I would be happy to share this! To get the SNES connectors I ordered two SNES extension cables and just used the female connectors of them. The SNES and ribbon crimp connectors are wired as following:

You can also see some resistors in the picture – these are actually for LEDs and a button and are not used here. A more detailed description for the assembly is given here. This is a diagram of the pinout of the adapter board:

The GPIO pinout of the Raspberry and of the corresponding 26-wire ribbon cable are shown here:

The connection between the GPIOs and the adapter board is as following:
  • GND to P6
  • VCC to P2
  • DATA 2 to P15
  • LATCH to P16
  • CLOCK to P18
  • DATA 1 to P22
This is how it should look after the assembly:

Here is another picture with the adapter attached to the Raspberry:

Having finished the hardware part I started with the software implementation. I decided for a C program to have the possibility to keep the CPU load as low as possible. Basically, the program has to do two things: First, it has to read the state of each button. A very good source for information about the NES/SNES controllers is also the documentation of the Uzebox. Second, it has to pass button events to a virtual keyboard. The uinput kernel module can handle the input subsystem from within the user space. I stumbled across a very informative article about the uinput kernel module. It is a two-parts article with part 1 here and part 2 here. The uinput module has to be manually loaded with this command:

To access the GPIO pins from within a C program you need to download and install the Broadcom BCM 2835 library. These commands download and install this library:

I called the program SNESDev and created a Github repository for it. You can find it at Here is a demo of everything working together for a quick game of a famous kart game:

This leads us to the end of this post. So far, I did not speak about a case yet. Having some experience with other laser-cut cases I already started to design a case for the Raspberry that also contains ports for two SNES connectors. When this is finished I will write about it in another post. UPDATE: You can now find a shell script in my Github repository that automatically installs all needed packages for RetroArch and various emulator cores, as well as SNESDev.

Certainly, I left out some information that you would be interested in. So, if you have any questions, comments, or questions, just send me a mail or write some comments below – I would be happy about any contributions!

Some obligatory legal stuff: The Raspberry Pi is a trademark of the Raspberry Pi foundation.

This entry was posted in Linux fun, microelectronics fun, programming fun and tagged , , , , , , . Bookmark the permalink.

128 Responses to SNESDev-RPi: A SNES-Adapter for the Raspberry Pi

  1. IIIBossonsIII says:

    Just a quick question guys… So if I got one of the modern USB copies of a snes controller (we had a megadrive II in our house :P) Will it still work okay with the emulator? I’m not actually a coder just a bit of a geek 😀 Thanks 🙂

    • Florian says:

      Yes, the USB-controller should be recognized as a joystick/game pad on the Raspberry. Maybe you need to enable the joydev module and export SDL_NOMOUSE=1 to make RetroArch work with it.

      • Alan says:

        would I run into any problems using 2 usb controllers(like the generic ones for playing games on your pc)

  2. IIIBossonsIII says:

    Excellent 🙂 Thanks Florian. I’ll give it a shot when my joystick arrives 🙂

  3. forenbenutzer says:

    I might have the corresponding case for your raspberry. 🙂

  4. Pingback: Major Update for RetroPie Setup | petRockBlog

  5. Pingback: PetRockBlock Pie – A (Gaming) Raspberry Pi Case | petRockBlog

  6. Tim says:

    In reference to your launcher project, there definitely is – Adavanced Launcher, which is a plugin for XBMC that is specifcally designed to launch emulators to extend your media center to include games. I see this as a fantastic way to integrate your great work for the raspberry pi because raspbmc is debian based that exists solely to launch XBMC and run on the rpi. My goal is to get your work working on raspbmc and launch the emulators through Advanced Launcher.

    • adam says:

      Any joy with this dude? I’m currently deciding between a windows-based mini-HTPC with XBMC running ZSNES (which I’ve got running perfectly on my windows laptop) or a RPi running RaspBMC, but have no experience with linux etc so no idea what emulator I’d use!

      • Florian says:

        Be prepared for a steep learning curve if you decide for the Linux approach. It is worth every second though.

  7. Pingback: Raspberry Pi Modded To Play Super Nintendo Games « My Web PC Tech

  8. cocopelao says:

    Great Work! i have been searching all over the web and your the guy in the center of the Pi emulation. Quick question i look at amazon for the snes extension cables, but there are so many I don’t want to get the wrong ones. The plan is to set it up with the case you designed, so I want the cut outs to match you think you can point me in the right direction?

  9. With the RPi being 5V intolerant, many projects have had difficulty addressing the 3.3V to 5V problem. Have you had any issues with your setup being ”underpowered”, especially in 2-controller setups?

  10. Chad Johnson says:

    I cannot get my snes games to run. I have checked everything and followed this all to a T! How do you actually run the games? Do you just type emulationstation? This only brings up Atari 2600 the list is empty!
    I have two snes roms in my roms snes folder and all lowercase .smc files. I have everything connected correctly but I can start a game but my controller is not working. I have everything soldered correctly. What are the exact steps to actually run a game with a snes controller on the GPIO pins. Can you write a description of this. I have searched all over the blog and for some reason I just cannot figure it out!

    Thank you,


    • Florian says:

      Hi Chad! Are you using SNESDev ( or the GPIO kernel module that can also be installed by the RetroPie setup script?

      If you use SNESDev, you have to start it with “~/RetroPie/SNESDev-Rpi/bin/SNESDev &”. Eventually, you have to make the binary executable before (with chmod +x ~/RetroPie/SNESDev-Rpi/bin/SNESDev). The ampersand starts the program in the background and you can start an emulator afterwards. When everything is set up correctly, pressing a button should lead to simulated key presses in the command shell.

      The GPIO kernel module can be tested with the command “jstest /dev/input/js0” or “jstest /dev/input/js1”

      I hope this helps!?

      • Chad Johnson says:


        Everything works as you mentioned but the command jstest /dev/input/js0 just returns invalid directory. The command jstest alone works so I know its installed. Do I run the & program in one window then open another terminal to type in emulationstation? When I type sudo ~/RetroPie/SNESDev-Rpi/bin/SNESDev & I just get initializing Pad and then I can push buttons on my controller and it shows up in the terminal but what do I do from here? Emulationstation is finally seeing my roms and I can start one but no controller still?

      • Florian says:

        Ok, so you are using SNESDev. This means that a virtual keyboard is emulated and not a game pad, which, in turn, means that we do not need “jstest”. If you are seeing the output in hte terminal when pressing a button on the controller the hardware part is working!

        >> Do I run the & program in one window then open another terminal to type in emulationstation?
        No, if you start SNESDev with & at the end, you can just press ENTER a second time when the program started and you should get back your cursor.
        BTW: You must not run X, when using EmulationStation!
        Since the D-pad of the controller is mapped to the arrow keys of the keyboard you should be able to move the cursor with the keypad. If not, you are maybe holding the second controller in your hands.
        Try to start a ROM without EmulatoinStation first. You can run a SNES rom by calling “retroarch -L /home/pi/RetroPie/emulatorcores/pocketsnes-libretro/ /home/pi/RetroPie/roms/snes/nameofyourrom.smc”.
        Press some buttons and compare the output in the terminal with the keyboard input configuration in /etc/retroarch.cfg.
        Really, as long as you see button presses as output on the terminal it is “just” a matter of software configuration now …

      • Florian says:

        Did you make any progress?

      • Chad Johnson says:


        Yes I am sorry I have been on vacation away from my Raspberry Pi. I figured out two things of importance I was doing wrong. I had one controller soldered to the Raspberry Pi and found out that the diagram for your one controller setup isn’t quite right. The Pins should all be the same but instead of Data 2, connect to Data 1 on the one controller setup. This made my controller work instantly and made me feel quite dumb that I was doing everything right but couldn’t figure out what I was doing wrong. Also, I was running emulationstation in X. Once I ran emulationstation at boot and used your advice to initialize the controller before running emulationstaion, everything worked flawlessly!

        Thank you very much for your time and help and such a great product! For your Time and effort can I send you my new Moldy Pi Plate, a creation for myself but based upon your creation of this SNES to GPIO on the raspberry Pi. I can send you the board for free for helping me.

        Thank you again,


      • Florian says:

        Hi Chad,

        Good to hear that you finally got it working!
        Sorry for the not-so-clear description of the one-controller assembly guide. I have added two more sentences to the description and hope that it became clearer now.
        Your Moldy Pi Plate really looks interesting and motivates further tinkering for this project 🙂 Thank you very much for your offer to send me a board! Since I know the prices of small scale PCB manufacturing I really appreciate your offer. I could send you a Petrockblock Pie case in exchange – if you are interested?
        I would suggest to send me a mail via the “contact” site for everything else.

  11. Alex says:

    I was thinking of just running Linux with an emulator installed with 2 USB NES controllers in the ports

  12. Pingback: Gamecon driver module for NES, SNES, and N64 controllers Added to RetroPie Setup Script | petRockBlog

  13. Daniel says:

    Hey Florian, I am soooo close to get everything working perfectly. You got no idea how much I appreciate your work. Keep up this kind of stuff.

    Right now I got one thing. Your script got the option to put emulationstation into autostart. Is there a possibility to automatically start SNESDev aswell? (I mean “~/RetroPie/SNESDev-Rpi/bin/SNESDev &”) because just putting emulationstation into autostart does not make my controllers work 😉

  14. Pingback: Super Nintendo Pi

  15. Patrick says:

    Hey Florian, everytime I try to start SNESDev I get an Error:

    -bash: xzsaqw: command not found


    first I thought, I have to reconfigure the keyboard layout back to standard to fix this problem, but the error still exists. Have you any idea?

  16. randyrobRob says:

    Very Nice, Just what many people are after.
    One question I have is. It doesn’t look like you’d be able to get this to run in Rasbmc because you need root access to install dependencies?

    Many Thanks Rob.

    • Florian says:

      I have no experience with RaspBMC, but by looking at the wiki of RaspBMC at I think that you could simply run the script with one of the described methods.
      If you manage to successfully use the RetroPie script with RaspBMC it would be great to post it here!

      • randyrob says:

        For those looking this is how you add uinput to startup

        SSH in to your Pi as root

        cd /etc
        sudo nano modules
        add the text “uinput” then press “ctrl+x” and “y” then “enter” to save changes
        sudo reboot

  17. Pingback: Raspberry Pi: Introduzindo a “Retrocomputação moderna” | Casa dos Nerds

  18. Pingback: The RetroPie Project: An Interim Report | petRockBlog

  19. Pingback: The RetroPie GPIO Adapter | petRockBlog

  20. Pingback: A Slice of Raspberry Pi Hardware « PointGadget

  21. Pingback: Video of RetroPie GPIO Adapter | petRockBlog

  22. suciarlak says:

    Hi Florian, when i connect the Snes controller to Pi i get an unlimited serie de characters in the command line, It stops if i disconnect the controller. I installed your Snesdv trough the RetroPie-Setup script, and all connections to GPIO ports seems be ok.

    Any ideas? How can i reconfigure or reinstall Snesdv cfg?

    • Florian says:

      Have you connected one or two controller(s)? If one, which pin out are you using?
      I have seen your request in the issues section of the Github repository – I will have a look at this tomorrow.

      You can connect to the Pi via ssh and disable the autostart n boot via the RetroPie script again. You could also do this manually via “sudo service SNESDev stop”.

  23. Thanks a lot for spending some time in order to compose “SNESDev-RPi: A SNES-Adapter for the Raspberry Pi | petRockBlog”.
    Thank you for a second time ,Delores

  24. Pingback: เอา Raspberry Pi มาสร้างเครื่อง Super Famicom อย่างเนียนเล่นกับตลับเกมได้ | Raspberry Pi Thailand

  25. daniel voigt says:

    There are some games that could be played with more than 2 players. Is it possible to build a 4-controller interface (much like the snes multitap) for RaspberryPi with this? I hope so, because I plan on building a 4 player arcade cabinet and the raspberryPi together with your adapter-pgb would make it cost a lot less money.

    • Miles Carter says:

      There is a GPIO joystick driver kernel module that supports up to six mix and match controllers, all sorts. See raspberry pi forums. Another cheap option is atmega OVR usb adapter, see the chips are ~$1.50 and you only need a handful of components. Diode, resistors, crystal

  26. Pingback: Un adaptateur de manette SuperNes pour le Raspberry-Pi » Underground Portables

  27. Pingback: The RetroPie Project: An Interim Report | petRockBlog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s