Cashews said:
grossaffe said:
First, your link is broken, but I think I managed to find the picture.
Looking at the schematic, that is an odd setup they have there; not what I was expecting to see. Let me know what you find out about those pins and I may have a better understanding of what's going on with their buttons. Worst case scenario, though, you can always cut traces and set them up as needed.
The other thing I wanted to say was that you can always provide power and ground through your FPGA (I assume you'll be using an experimenter board such as a Basys or Nexys, and those should have power and ground pins you can connect to external components).
Sorry about the broken link! (How embarrassing) I fixed it now, so verify that you were looking at the same picture. Here's a link to a picture I took after cracking open the GB case:
http://i.imgur.com/qgVrG9V.jpg
Oddly enough, the link is forbidden access when clicked, but it's perfectly fine if I go to a previous point in the url and then navigate from there. But still, same diagram.
The black pads underneath where the buttons are (on the arrow pad for example) are pretty clearly connected when a button is pressed. But those black pads don't appear to be a metal (unless it's just very old metal? The GB is rather old after all) and I'm hesitant to solder anything to them. It'll be tricky to get the GB to turn on without the case, but once I get that I can get an oscilloscope in there I suppose and try to see a current. Any suggestions on how to get a probe in there temporarily? How about permanently? (By permanently, I mean in a way where we can close the case and use it, would require soldering I assume.)
You're on your own here.
Taking a second look at that diagram, here's what I hypothesize is going on: The gameboy polls the buttons, and does so 4 at a time. I think it sets pin 15 to a negative voltage when it wants to check the A, B, Start, and Select buttons, and it sets pin 14 to a negative voltage when it wants to check the d-pad. So if we look at when pin 15 is negative (and pin 14 is not; probably 0 volts or something), if the buttons aren't pressed, it remains an open circuit and nothing happens. If one of the buttons is pressed, then the diode associate with it becomes forward-biased allowing a current through and pulls the pin associated with the button to a negative voltage.
If both the A button and the Right button are pressed (still pin 15 negative and 14 0), the diode associated with the Right button will be reverse-biased, not allowing any current through, so it does not matter. If the A button is not pressed and only the Right button is, then there will likely be no bias on the diode thus nothing happens. If pin 15 is 0 and pin 14 is set to negative, now the diodes associated with the D-pad will be forward biased when the d-pad directions are pressed and the diodes of the buttons will be reverse-biased and thus the buttons are ignored.
After having written all of that out, I also realized they could just be using pull-up resistors on the input pins (10-13), and then set whichever output pin they want "active" to zero, and that should have the same effect, except you wouldn't be using negative voltages on the device.
So anyways, I would think you could replicate this if you had your FPGA poll the buttons in the same way. Use a register to store the most recent value for each button and only overwrite it when you've polled that button again, so it doesn't look like the button is being pressed multiple times, but rather just being held down.
And we're using a Nexys Spartan6 FPGA, I'm sure it has Vcc and GND pins but I've never used them before.
I assume that to be the Nexys3, then which is the board I have. Each of those PMOD connectors on the bottom has two voltage pins and two grounds to go with eight data pins. Voltage and ground should be labeled right on the board, so you don't even need to look it up in your reference manual (although you'll probably want to use to figure out your UCF for the data-pins.