Homepage › Forums › RetroPie Project › Everything else related to the RetroPie Project › GPIO confusion
Tagged: controllers, GPIO, SNES
- This topic has 15 replies, 2 voices, and was last updated 10 years, 6 months ago by bdecagny.
-
AuthorPosts
-
07/16/2013 at 20:58 #2489AnonymousInactive
I am ready to wire up a SNES female plug to the GPIO pins on my RPi. I am a little confused about the pins, though. You mention here using:
GND to P6
VCC to P2
DATA 2 to P15
LATCH to P16
CLOCK to P18
DATA 1 to P22But the GPIO uses these:
VCC (3.3V): pin 1
Ground: pin 6
Clock: pin 19 (out)
Button: pin 11 (in)
Latch: pin 23 (out)
Data 1: pin 7 (in)
Data 2: pin 5 (in)My question is… if I hard-wire the SNES plug to pins 1, 8, 15, 16, and 18 should the RPi instantly recognize the SNES controller plugged into it on boot? (I installed from the binary image and haven’t updated any software)
Also, why the change in pins for the GPIO?
Thanks!
07/16/2013 at 20:59 #2490AnonymousInactiveSorry, I know it should be pin 6 for ground, not 8.
07/16/2013 at 21:01 #2491AnonymousInactiveHahaha. I just realized that the numbers from LOST made me type 1, 8, 15, 16. Pop culture gets ingrained!
07/17/2013 at 06:50 #2495petrockblogKeymasterI modified the pins for the RetroPie GPIO Adapter to match them with the gamecon driver (https://www.petrockblock.com/2012/08/26/gamecon-driver-module-for-nes-snes-and-n64-controllers-added-to-retropie-setup-script/). After that I also adapted SNESDev (https://github.com/petrockblog/SNESDev-RPi), which is a user-space driver for the RetroPie GPIO Adapter. So, if you want to be on the safe side, I would recommend to use the pin out of the RetroPie GPIO Adapter, which is described at https://www.petrockblock.com/2012/10/21/the-retropie-gpio-adapter/ and https://www.petrockblock.com/2013/07/09/getting-started-with-the-retropie-gpio-adapter/.
07/17/2013 at 17:21 #2497AnonymousInactiveThanks for the answer. I will connect the wires according to the GPIO adapter pinout. One more question…
To use the Gamecon driver, do I need to download any extra software, or does the 1.6.1 image include that driver? If it does not include it, does 1.6.1 include the SNESDev driver? Essentially, is the SNES plug ready to go once wired?
I know the easy thing would be to just wire it up and try it, but this has been one of the busiest weeks of my life. And all I can think about is getting the RetroPie project finished! Ha, thanks for the great work on the RetroPie.
07/17/2013 at 17:42 #2498AnonymousInactiveNever mind. I looked at the revision history and saw that you added GPIO drivers in version 1.5. However, I saw a response in the comments on the same page that you have to manually enable SNESDev. I guess this goes back to me trying out the SNES plug after I wire it up and seeing if it works!
I also see that you have uploaded version 1.7! I am excited to try out ESconfig. I hope it is what I was envisioning as a way to add a controller inside Emulation Station.
07/17/2013 at 18:14 #2499petrockblogKeymasterYes, I need to enable SNESDev manually (e.g., with the RetroPie Setup Script).
I would be glad to get feedback about ES-Config to further enhance it.
Good luck with your project!
07/23/2013 at 16:42 #2525AnonymousInactiveAlright, I got my SNES port wired up over the weekend, and it works wonderfully! I just had to go into RetroPie Setup and enable SNESdev to start on boot. I have another question, though.
I have not added a momentary switch yet, but I hope to in the future. I understand that the switch is able to do software functions like dumping a ROM or shutting down the unit. My question is… can the switch also turn the RPi back on? After I shut down, I always have to take the power cord out and plug it back in when I want to play again. Does the GPIO allow a power switch to turn the unit on?
Thanks!
07/23/2013 at 16:45 #2526AnonymousInactiveAbout ES config, I love it. I was able to set up the SNES controller as P1 and a USB controller as P2. No problems! One thing that I did find confusing, though, is that you have to press a button on P2 controller after you set up the buttons for P1 to set A,B,X,Y for P2. There needs to be some kind of text prompting you to do this.
07/24/2013 at 22:07 #2538AnonymousInactive@petrockblog, is it possible to assign different GPIO pins to be the clock and latch for P2 under SNESdev? It seems like it would be easier to jumper to separate pins, rather than share a pin with the P1 controller.
Thanks!
07/25/2013 at 07:15 #2541petrockblogKeymaster[quote=2538] @petrockblog, is it possible to assign different GPIO pins to be the clock and latch for P2 under SNESdev? It seems like it would be easier to jumper to separate pins, rather than share a pin with the P1 controller.
Thanks!
[/quote]
Currently, there is no configuration file to assign the pins to be used (still on the to-do list). However, you could change the according lines in the sources of SNESDev in the lines at https://github.com/petrockblog/SNESDev-RPi/blob/master/src/SNESDev.c#L140. You would just have to re-compile SNESDev afterwards.Hope that helps!?
07/26/2013 at 21:29 #2544AnonymousInactiveI found this section of SNES-Dev…
if (get_rpi_revision()==1)
{
gpads[0].port = 1;
gpads[0].pin_clock = RPI_GPIO_P1_19;
gpads[0].pin_strobe = RPI_GPIO_P1_23;
gpads[0].pin_data = RPI_GPIO_P1_05;
gpads[0].type = GPAD_TYPE_SNES;
gpads[1].port = 1;
gpads[1].pin_clock = RPI_GPIO_P1_19;
gpads[1].pin_strobe = RPI_GPIO_P1_23;
gpads[1].pin_data = RPI_GPIO_P1_07;
gpads[1].type = GPAD_TYPE_SNES;
} else {
gpads[0].port = 1;
gpads[0].pin_clock = RPI_V2_GPIO_P1_19;
gpads[0].pin_strobe = RPI_V2_GPIO_P1_23;
gpads[0].pin_data = RPI_V2_GPIO_P1_05;
gpads[0].type = GPAD_TYPE_SNES;
gpads[1].port = 1;
gpads[1].pin_clock = RPI_V2_GPIO_P1_19;
gpads[1].pin_strobe = RPI_V2_GPIO_P1_23;
gpads[1].pin_data = RPI_V2_GPIO_P1_07;
gpads[1].type = GPAD_TYPE_SNES;
}Is this the only place that I would need to make changes for clock and latch for player 2? Thanks!
07/27/2013 at 10:09 #2546petrockblogKeymasterYes – that is the only place!
06/24/2014 at 22:18 #9325benoitGuestHi
I have a question.
I don’t understand in the code it is written that the pins 19, 23 and 05 (depends of config) are used.
But in the SNESDev cable it is said that clock for instance is on pin 24.
I don’t understand, is the code up to date ?
Actually I am trying to make a PITFT and a single NES controller directly connected to the GPIO work together. But seems that some GPIO (24 as far as I know) is used by bothCan you help me on that ?
Thnak you
Benoit06/25/2014 at 06:29 #9389petrockblogKeymasterYou can find the most recent version of SNESDev at Github – the lines with the pin usage start here. Pin 24 is currently not used.
I hope that helps!?
06/25/2014 at 15:34 #9428bdecagnyGuestThank you for your answer
I got the last version on githubCould tell me which pin are used by SNEDEV. Maybe I am not plugging my controller on the right place.
For now looks like I have a comflict between my PITFT and the controllerthanks again for your help
-
AuthorPosts
- The forum ‘Everything else related to the RetroPie Project’ is closed to new topics and replies.