so, exactly HOW do controllers work?

Do you have a technical question that doesn't really fit a specific console? Want some general info on electronics, hacking, making cookies, etc? Here's the place to ask! Go nuts.

Moderator: Moderators

Post Reply
17daysolderthannes
Posts: 381
Joined: Thu Oct 18, 2007 7:15 am

so, exactly HOW do controllers work?

Post by 17daysolderthannes »

now, I'm not asking for the dumb answer of "you push a button and the console recognizes it," I mean what exactly takes place on the electronic level when you give inputs to your controller? Does it go by frequency? amplitude? voltage (I know analog joysticks use potentiometers)? Also, I've read once (but can't remember where) that an NES controller, for instance, acts like all the buttons are "open" and when you press the button, it "closes" that particular button and adjusts the signal accordingly, like the reverse of a light switch (which would turn on when you push the button). Also, what are the little round black pieces on the bottom of the silicon rubber pieces that go between the button and the main board? Are they simply some sort of rubber or is there some other property to them? Every time I search the internet I come up with nothing, even howstuffworks.com only gives the dumbest of dumb explanations.
vskid
Senior Member
Posts: 6314
Joined: Fri Mar 25, 2005 8:25 am
Steam ID: vskid3

Post by vskid »

Pushing a button completes the circuit for that button. This pic shows the pinout of the N64's controller chip, chip gets signal from button, converts that to a signal that the system interprets as a button press.
Image
(Not my pic, someone else on forum made it a few years ago.)
Image
gannon
Moderator
Posts: 6974
Joined: Sun Apr 04, 2004 4:48 pm
Location: Near that one big lake
Contact:

Post by gannon »

Really depends on the console.
Atari controllers used button matrices for the controllers, so just a bunch of data lines.
NES/SNES controllers used a serial format that is synced with a clock from the console and read when a pulse is sent (1/8th or 1/16th of the clock)
Other serial based controllers use similar formats, although I think some may be cutting down on wires by using data lines for either bidirectional commands or using a more complex packet structure in the data line for async communication
nitro2k01
Posts: 651
Joined: Tue Dec 19, 2006 12:41 pm

Re: so, exactly HOW do controllers work?

Post by nitro2k01 »

17daysolderthannes wrote:Also, I've read once (but can't remember where) that an NES controller, for instance, acts like all the buttons are "open" and when you press the button, it "closes" that particular button and adjusts the signal accordingly, like the reverse of a light switch (which would turn on when you push the button). Also, what are the little round black pieces on the bottom of the silicon rubber pieces that go between the button and the main board? Are they simply some sort of rubber or is there some other property to them?
That's a thin layer of carbon that makes the pad conductive. When you press the button, the carbon is pressed against the carbon on the circuit board. (Usually the shape of E's and 3's intertweened) when that happens the circuit is closed, otherwise not. You can use different ways to detect that the path is closed, a common one is something like the scehmatic shown below:

Code: Select all

      Button
       V
+V o--E3--o--o Input
          |
         | |
         | | R
         | |
          |
          o Gnd
R is a resistor of some value (Usually 10k or so, but the value doesn' matter for the principle) The resistor pulls down the voltage level to a logic 0 that input reads when the button is in the neutral state. When the buttons is pressed, the carbon pad gets shorted and the positive voltage (V+) makes the input read a logic high signal.
That's a very basic model used in the NES and SNES controllers for example.
There are more complex ways of doing this, like adding a diode net to use a limited number of leads to read a greater number of buttons. I don't know how common this is in game controllers, but I have seen it more than once in toy synths and musical keyboards without pressure sensing, which have way more buttons than a game controller.
It's also possible to use a matrix of outputs and inputs which can look like this:

Code: Select all

  o1   o2 Out/In
  |    |
  /----/------o i1
  |    |
  /----/------o i2
  |    |
  /----/------o i3
  |    |
  /----/------o i4
This is the way the Gameboy reads out data. (AFAIK every GB model up until GBA SP does it this way, not sure about GB micro) The / crossings are where b the switches are. o1 ad o2 areoutputs, and i1-i4 are inputs. To read the state of the button at the crossing between o2 and i3 for example, you'd need set o2 high and 01 low (In order to avoid interference) and then read the value i3. If it reads high, the button is pressed.

That's how you read the raw data. The next step is to somehow transfer it to the CPU. The first model is usually preferred for external hand controllers, together with some way to transfer the data.
You can transfer it in parallel, with one wire for each button. (Or using diodes, a pair of wires for every button) Or you can use a serial protocol, where the data is transferred one bit at a time over a cable.

Usually the data is transferred serially for new consoles. NES, SNES and everything beyond. Sega used some sort of parallel protocol up until Genesis, at least that was my conclusion from my experiments as a child. NES/SNES controllers are using a very simple protocol that uses Ground, positive voltage, a clock, a data return line and a reset line.
The reset line exists only to make the circuit restart the read process. The clock signal onsists of a train of pulses. On every pulse, the controller chip (A CD4014 as far as I remember) reads on of the bits and returns on the data line. On the next data pulse, it reads the next button and so on.

Starting with the 3D generation consoles, (Playstation, N64) the consoles probably got more sophisticated, bi-directional protocols, which allowed more complex data to be transmitted, and also opened up for more possibilities for extended controllers. (Special controllers, analogue controllers, rumble packs)

Even newer generation consoles (XBox+X360, PS2?, PS3, Wii?) are using USB. You have a USB controller chip in the controller which uses some way to read the data and return it using the USB protocol. (Which means that any such controller can be used with a regular computer, if the right driver exists) New generations consoles may also have support wireless communication, using bluetooth (Wii, PS3?) or similar technology.

Did I forget anything?
My blog
ASM Retro <- Gameboy Classic Backlight

Being the sadistic bastard I am, I have covered Frog's left eye with a Santa hat.

Last edited by nitro2k01 tomorrow, 1:48 pm; edited 1 time in total
17daysolderthannes
Posts: 381
Joined: Thu Oct 18, 2007 7:15 am

Post by 17daysolderthannes »

nope, that pretty much covers it. That explains why old controllers are so damn reliable, there's very little to the mechanical aspect of them, just a conductive material to mash against the circuit board.
timmeh87
Senior Member
Posts: 3047
Joined: Mon Nov 14, 2005 10:19 pm
Location: Ontario, Canada

Post by timmeh87 »

I always thought the buttons were set up to pull down a pull-up network, vs pulling up a pull-down network as you have shown.

No source on that though. Wouldnt really change much.
Image

"Linux is only free if your time is worthless"
nitro2k01
Posts: 651
Joined: Tue Dec 19, 2006 12:41 pm

Post by nitro2k01 »

timmeh87 wrote:I always thought the buttons were set up to pull down a pull-up network, vs pulling up a pull-down network as you have shown.

No source on that though. Wouldnt really change much.
Either design works, but maybe you're right that neutral pull-up networks are more common. Depending on how the inputs on the IC are designed, this could possibly save some energy.
But as you say, not much of a change, the principle is all the same.
My blog
ASM Retro <- Gameboy Classic Backlight

Being the sadistic bastard I am, I have covered Frog's left eye with a Santa hat.

Last edited by nitro2k01 tomorrow, 1:48 pm; edited 1 time in total
Post Reply