Homepage › Forums › RetroPie Project › GPIO Adapter, ControlBlock etc. › Using original NES controller with bi-directional logic level shifter
Tagged: level-shifter, NES Controller, SNESDEV, wiring
- This topic has 4 replies, 2 voices, and was last updated 9 years, 6 months ago by
petrockblog.
-
AuthorPosts
-
02/21/2015 at 23:09 #88534
ste2425
ParticipantHi guys
Im using the following logic level shifter:
This is because my NES controller requires 5v to function correctly so this allows me to run the controller on 5v without frying the RPI.
I am however experiencing some strange behaviour. Firstly everything is connected up at the moment by jumper wires but before i solder it all up i wanted to ask can anyone predict problems with using a level shifter?
My issue is jstest reports only the A button being pressed whilst all others are not pressed.
Im using the snesdev driver enabled to check pads and button presses.
Its wired up as follows:
Data: 5
Clock: 19
Latch: 23Snesdev is not maintained by the retropie people is it? Would my guestion be better directed at them?
Thanks all
02/22/2015 at 08:11 #88568petrockblog
KeymasterActually, I am the author of SNESDev.
My experience is that you can poll NES controllers also with 3.3V so that you do not need level-shifters at all ad things get less complex! The RetroPie GPIO Adapter also uses the 3.3 V supply voltage.
02/22/2015 at 13:49 #88585ste2425
ParticipantAhh awesome, thanks for creating it!
Yea i tried without the shifter running on 3v and nothing, jstest reported no response. I then briefly ran it on 5v and jstest showed life. Admittedly i cant remember which buttons i pressed, probably only A. I then quickly turned it all off for fear of damaging the Rpi. It was from this i concluded a shifter would be required.
Ive read that there are three types of controllers, ones that are 3v compliant, ones that require 5v power but can run on 3v logic and ones (like mine) that require 5v across the board.
Ive since soldered up the shifter and im getting better results, however still only the A button respond, however this time its a solid yes no when i press the button. Previously it would flicker one way or the other, so soldering it up helped with that.
I remember reading on here about people where only the A button would respond but can’t find the threads now.
Thanks Stephen
02/22/2015 at 14:56 #88597ste2425
ParticipantAnother update. It works with data on pin 7, however on pin 5 only the A button reports any response. So Emulation station sets up the controller correctly when using pin7 however this reports as player two. What is the difference if any between the gpio pins? Could it be a damaged pin on the rpi?
Is it possible to tell snes dev to use different gpio pins for player one and two?
Could it be because of this?
“Pins 3 and 5 are also used for I2C which requires a pull-up in this case to 3V3, so it is already on the board as many I2C devices can be connected but only one pullup is required on each pin.”
From: source
EDIT:
Fixed it, changed the data1 pin to 7 and data2 to 10. Then rebuilt it from source and all working grand.
If you open for pull requests ill add changes to make the data, latch and clock pins optional overrides according to the config, shouldn’t be hard at all looking at it.
02/24/2015 at 19:49 #88923petrockblog
KeymasterSure, just post a pull request!
-
AuthorPosts
- The forum ‘GPIO Adapter, ControlBlock etc.’ is closed to new topics and replies.