Arcade Cabinet Part II: Electric Boogaloo
(And for once, that title isn’t far off from the truth!)
Let me start off by saying I didn’t do much original stuff here. This post refers to two boards. What I did was:
- take schematics from the Interwebs
- make superficial tweaks (which will be discussed shortly)
- lay them out onto circuit boards
- buy said circuit boards
- solder up said circuit boards
- tinker until said boards worked.
Most of the hard work was done by Raphaël Assénat over here. I took his schematic, made some tweaks, and built. Those tweaks were:
- I kept hearing about people having issues with Zener diodes on the USB data lines. Therefore, I decided that since my ATMega168A was going to run at 12MHz, I’d run it at 3.6V (this is technically not allowed at 12MHz if you read the datasheet strictly, but in reality it’s totally fine). In fact, my ATMega168A runs at almost 3.9V due to the particular diodes I’m using not having the desired drop… so the USB runs hot (should be closer to 3.3V) and the ATMega runs happy. However, I also left in the ability to populate Zeners and just jumper out my changes, which is what I ended up doing (both methods worked just fine though – my work PC and home PC both saw both prototype boards).
- I changed which I/O pins are being used for the controllers. Partly, this is so I could add a 5th controller, so I could stuff one in a Tribal Tap multitap. Partly, it’s because I could.
- I changed the code to support 5 controllers (but then I backed it down to 4 again, as I really don’t ever intend to use 5, and responsiveness might take a hit?) and 12 buttons per controller as opposed to the original 8. The reason I did this was because I built my own “SNES controller” which has 4 directions and 12 buttons.
- Unlike the original 4nes4snes boards, mine are all through-hole construction, because I am too lazy to do surface-mount soldering.
This board is the one that closely mirrors the original design. The other one doesn’t populate the Zeners near the USB, and uses rectifier diodes for voltage regulation, and 1N4148 diodes for the data lines coming from the SNES controller. In this case, the SNES controller’s power comes after only one of the two rectifier diodes, so it’s relatively close to the +5V it expects. Then the data coming back goes through one of the signal diodes, dropping it roughly the same as the second rectifier diode. The idea was to save a few parts’ worth of diodes and keep the ATMega running at roughly 3.6V. (I’ll post the schematic shortly, which might make things a little more obvious.)
This seems like a good opportunity to mention one of my favorite devices: the Bus Pirate from Dangerous Prototypes. It’s a wonder tool that lets you talk to all kinds of devices (in this case, it programmed my ATMega using the AVRDUDE software). I got my Bus Pirate awhile back from Seeed Studio, who, interestingly enough, also made these PCBs for me with their Fusion PCB service. It was my first time using Fusion PCB, but I got my boards in just under 3 weeks, and they work perfectly and look sharp (despite my mistakes with the solder mask), so I’m sure I’ll use them again in the future.
The SNES controller board is much more straight-forward. Take schematic from here, layout on board. The results are here.
Some issues with soldering this first one. My solder station’s tips are really wide, so I’ll be buying new ones shortly. On the end, you can see 4 pins, labeled Latch, Clk, Data and Data. Pin 3 (the first “Data”) has the option of placing a diode or resistor in series. I chose not to do that on this prototype (you can see on the bottom that nothing is populated). Originally, I’d thought to put the diode for my SNES-USB design on this board, but then I realized it’d be difficult to use a regular SNES controller, which doesn’t have that diode, so I moved it onto the other board. I left it on here in case there was another reason for it I couldn’t think of at the time. Latch connects to Latch on the SNES-USB, Clk to Clk, and then Data goes to one of the numbered pins 1-5 (for controller 1 through 5). Vcc and GND must also be connected between both boards.
So, does it work?
See for yourself. I will post the source code changes to add the ATMega168 support, as well as the 12-button support shortly, along with the board designs, so you can make your own using Fusion PCB or whatever service you like (both are 2 layer boards, so I don’t really recommend doing this at home).
Got a question or comment? Feel free to leave a message!