News for hackers. Stuff that matters.
Re:Nintendo Controller Teardown by kh_hk on Thursday November 19, 2015 @03:50PM (#10597542)
Hmm, I am not 100% sure, but I recall the NES gamepad uses an 8 bit shift register not a microcontroller.
Re:Nintendo Controller Teardown by rasz_pl on Thursday November 19, 2015 @06:32PM (#10598464)
Yes, its Genesis 6 button Pads that used microcontroller.

Sega Master system had basically an atari standard port, Genesis 3 button pads added select signal for swapping two pages (alternating between a/b c/start), finally 6 button controller added third page, but to trigger it you needed to pulse select line 3 times, and this was deemed to complex for discrete logic, hence microcontroller in 6 button pads.

Re:Nintendo Controller Teardown by jpwright on Thursday November 19, 2015 @03:59PM (#10597617)
Yup! It's a humble 4021N.
Re:Nintendo Controller Teardown by 6502nerdface on Thursday November 19, 2015 @04:19PM (#10597762)
Yes! Also goes by part number 74LS165 (edit: actually they are just similar) [1]. Here's how to use it in your game code: http://wiki.nesdev.com/w/index.php/Standard_controller

Basically you write high voltage to the "strobe" line of the shift register in the controller, putting it in a state where it continuously updates to reflect current button presses. Once you remove the high voltage, it "freezes" its 8-bit state representing whatever combination of the eight buttons were last depressed, and then you make 8 successive reads from the shift register's serial line, reading off the state 1 bit at a time. It's up to the game software to be robust against bouncing, as well as against a tricky hardware bug where the DMC module of the NES's audio processing unit conflicts with the latching mechanism used by the controller's serial line. Needless to say, this must all be emulated by accurate NES emulators, too :)

[1] http://www.datasheetcatalog.com/info_redirect/datasheet/phil...

Re:Nintendo Controller Teardown by cnvogel on Thursday November 19, 2015 @04:52PM (#10597986)
Look closely, the '165 is a little different, both in functionality and pinout. You'll not be able to swap in one for the other. -- But yes, both are parallel in, serial in/out shift registers.

http://www.nxp.com/documents/data_sheet/HEF4021B.pdf http://www.nxp.com/documents/data_sheet/74HC_HCT165.pdf (pinout for LS is the same)

Re:Nintendo Controller Teardown by duskwuff on Thursday November 19, 2015 @04:55PM (#10597999)
The 4021 and 74LS165 are similar, inasmuch as they're both PISO shift registers, but they're not the same part. Here's representative datasheets for both parts from TI:

http://www.ti.com/lit/ds/symlink/cd4021b.pdf

http://www.ti.com/lit/ds/symlink/sn74ls165a.pdf

I don't think the differences are relevant in this application, though.

Re:Nintendo Controller Teardown by kh_hk on Thursday November 19, 2015 @04:26PM (#10597806)
Maybe relevant, a while ago wrote a post about using an Arduino to interface a NES gamepad as HID device.

http://eskerda.com/arduino-nes-gamepad/

Repo with full instructions: https://github.com/eskerda/arduines

Re:Nintendo Controller Teardown by mrob on Thursday November 19, 2015 @09:58PM (#10599309)
Bouncing isn't an issue if you poll the button state once a frame, because almost all switches will finish bouncing within 16ms.
Re:Nintendo Controller Teardown by kh_hk on Thursday November 19, 2015 @04:18PM (#10597751)
Humble indeed, I find it really clever
Re:Nintendo Controller Teardown by fictivmade on Thursday November 19, 2015 @04:27PM (#10597816)
Dave from Fictiv here -

Thanks for the contribution and wiki article -- will update the post accordingly and welcome any other feedback/suggestions. Teardowns are all about learning + community input so keep the comments coming :)

Re:Nintendo Controller Teardown by dyselon on Thursday November 19, 2015 @04:55PM (#10597998)
SNES is a 12 bit shift register, as well.
Re:Nintendo Controller Teardown by Orangeair on Thursday November 19, 2015 @05:22PM (#10598136)
Technically a 16-bit register if I'm not mistaken (but that's just splitting hairs; it only uses 12 bits).

Here's a short article on the configuration: http://www.gamefaqs.com/snes/916396-super-nintendo/faqs/5395

Re:Nintendo Controller Teardown by arantius on Saturday November 21, 2015 @01:36PM (#10607577)
Couldn't help but notice this. The next page down, in the image, they get it right. And are similarly loose with their terminology throughout the article.