Yes, I found my old SNES controller and, yes, it uses the same communication protocol as the NES controller and, by extension, the Zinger. In other words: it is a decent substitute until a working joystick shows up.
First thing I did after unearthing the controller, was to figure out its pinout. I ended up learning the order of things from the Schematics, Ports, and Pinouts page at the SFC Development Wiki. There's no fancy drawing this time, just this photo:
SFC Development Wiki provides different signal names compared to the ones at wiki.nesdev.com; using data, latch, and clock instead of D0, OUT, and CLK. I like the former, more descriptive ones, better. Next, I hooked up the controller to the Arduino Uno and ran my test program.
Lo and behold, it worked. I made contact! What does that mean? That I'm able to show current controller state, which buttons are held down at any moment, in a serial monitor on my Mac.
Finally, I've made progress.
What you see in the screenshot above is the result of me pressing buttons frantically during a test session. The controller state fits in a single byte, each bit representing one of the buttons. Can you guess which buttons I pressed in each case with just the screenshot as your guide? There's a hint in the source code window.
On the subject of source code, my test program is pretty simple. On a high level, it implements the NES controller protocol using the Arduino's SPI hardware. At roughly 60 Hz the controller is asked nicely to latch the button state into its shift register and start delivering bits until a full byte is received.
That byte is sent out on the serial line for me to marvel at in the monitor.
I won't go into more details here. The source file is short (< 100 lines) and heavily documented, so I strongly suggest anyone interested to take a closer look and study it.
It's great to be on track again. Now, time to focus on the Game Boy.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.