SNES controller input to GBA input

Started by Gummo, October 13, 2004, 03:17:09 PM

Previous topic - Next topic

Gummo

I want to be able to use a SNES controller on a Gameboy Advance and I just want to know if my idea on doing so would work.
The snes controller uses a parallel-in, serial-out shift register to hold and transfer button presses. Could I have the data transfer to a serial-in, parallel-out shift register? That way, all the button presses are represented seprately off of each output line so the gba can read them?

NFG

If you understand the fundamental operation of the controller this well and can whip out the lingo like you know what i tmeans I have to wonder why the answer isn't obvious for you.

You're talking about taking an encoded output and decoding it into a single pin for every switch.  I ask you: Why wouldn't it work?

Aidan

As long as you can keep sync between the controller and the shift registers, no problem. ;)
[ Not an authoritive source of information. ]

Gummo

QuoteIf you understand the fundamental operation of the controller this well and can whip out the lingo like you know what i tmeans I have to wonder why the answer isn't obvious for you.
I actually just learned about the basics of sequential networks in my computer organisation class in one day (on Monday, a 3 hour class).  Thats how I know the lingo :P
Which in turn, I then understood how the snes controller worked.  I didn't quite understand before I had the class, but after I had it, things just came together inside my head.

Quote
You're talking about taking an encoded output and decoding it into a single pin for every switch. I ask you: Why wouldn't it work?
Well, when you say it like that, it makes it seem obvious that it will work! :)


Im so glad this will work, because for a while I thought the only way would be to use a microprocessor and all that stuff.  All I need to do now is to go find some 8-bit SIPO shift registors and some lm555 timers.  

Gummo

Ok, after getting the SIPO shift registers, ive been working on decoding the controller data.  Im able to decode all the button presses and can test them using leds (I had to use a logical Not circuit on each of the outputs because when the button is not pressed, the output is high). However,  I have the clock and data latch lines hooked up to the snes system to get the real timing.  What would I have to do inorder to get the correct timing (or as close as possible) without having to use the snes system?

NFG

It doesn't really matter if you have the correct timing or not, as long as it's fast enough to update at a decent speed.  I would suggest 60Hz as a minimum sampling rate for the entire button set.  If you latch them and hold them until the next update then the receiving system or encoder can sample it whenever it wants to and get the most recent result.  In the case of a 60Hz rate the receiving system will have accurate buttons for every screen update, and that's as fast as the player could possibly be expected to react to things shown on the screen.

Guest_Aidan

As Lawrence says, the timing is not actually very critical. The data latch line just tells the pad's internals to copy the state of the buttons into the data latches. Once that has been done, you can then clock the data out at whatever speed you want.


phreak97

firstly, can anyone point me to somewhere where i might learn about these shift registers ant timers etc? im very interested in this. also if gummo is going to connect this to a gba, why not use the clock inside the gba? does anyone know what speed it is?

Gummo

Quotefirstly, can anyone point me to somewhere where i might learn about these shift registers ant timers etc? im very interested in this.
Just do a search on google for "shift registers" and "LM555 timers". I use the lm555 IC for my timer.

Quotealso if gummo is going to connect this to a gba, why not use the clock inside the gba? does anyone know what speed it is?
probably wouldn't help much to use the gba's clock, even if I knew where to locate it. I wouldn't even want to use the gba's clock either because I would like to use the snes controller decoder for other projects like being able to use any snes controller on a different system. So if I rely on the gba's clock, I wouldn't be able to do such a thing.


Right now, I'm trying to think of how to make the data lactch and clock circuit.  The cycle I'm thinking that will work is to do this:
1) Send out a pulse to the data latch line. This will load all the button presses into the PISO shift registers and will be ready to be clocked.
2) Clock that register 16 times to get all the data from that PISO shift registers and send them to the SIPO shift registers to be read.
3) Do nothing, but allow access to the SIPO shift registers to read each of the button presses.
4) restart back to #1.

Sounds like it will work to me, but making the circuit to do that cycle I would need some help in the right direction!