I got a few new controllers for testing the 4Gen-USB and one of them was this…
I applied for a couple of USB PIDs from OpenMoko for the 5nes5snes project, and they were approved!
There are two modes for 5nes5snes:
- 5 controllers with (up to) 8 buttons each (VID 0x1D50, PID 0x602C)
- 4 controllers with (up to) 12 buttons each (VID 0x1D50, PID 0x602D)
NOTE: Please please please do not use these for anything other than these two configurations. If you make another configuration, you will need to use a different VID/PID pair. Sorry, but it can cause issues with some PCs if you re-use these.
Thanks, OpenMoko!
Hello yet again to all two people who read this blog! Files are now posted in the “Project Files” link at the top of the page. This includes any hardware or software designs I’ve done so far. Please note that all source code is released under the GPL v2 (except where otherwise stated), and all hardware designs are licensed under CC BY-SA v3.0.
(Some/many files may not include the license files in them just yet. Consider this your notice. All I ask is that if you use these projects, please do not pass them off as your own — please provide a link to my site at a minimum.)
Speaking of which, the 5nes5snes project (and eventually, 4Gen-USB) would not be possible without the prior work done by:
- Raphael Assenat of RaphNet
- The V-USB library from Objective Development
(In case you are wondering, the V-USB library is licensed under GPL v2, so making the various projects licensed under GPL v2 simplifies things for me significantly.)
If you believe that my projects use something of yours and you feel that you haven’t received due credit, please drop me a note and we’ll make sure that this gets resolved.
Okay, so, you know how I said that using an ATMega8515 would be too easy? Well, I proved it
Still fits on a 50x50mm board (if you do it diagonally as I did… Seeed Studio is going to hate me for this one). The majority of the parts are on the underside of the ATMega. This picture isn’t the very final one — I’ve added a (non-standard) ICSP port to it as well.
This has some benefits (smaller case, nice mitered edges everywhere, the knowledge that it can meet timing to work with 6-button pads, etc.) I plan to order both, and write the code for both designs and post it. Updates to follow when the boards arrive and are tested.
Another day off, another project. This one is the 4Gen-USB. It’s very similar to Raphael Assenat’s 4nes4snes, but for Sega Genesis/Megadrive controllers. For this one, I’ve chosen to use an ATTiny84A (same micro as 5nes5snes-tiny) and add shift registers for the controller data. This probably requires some explanation as to why, so I’ll step you through my thought processes:
- To get 4 controllers’ data, you need 6*4 (24) I/O plus a select pin, so 25 total.
- For USB, you need two more. Now we’re up to 27.
- To keep ISP support, you need to leave the RESET pin alone. That’s 28.
- The cheapest ATMega that has that much I/O is ATMega8515, which runs about $2.43 @ qty. 25 at Digi-key.
- ATTiny84A costs $0.87 @ qty. 25, but only has 12 I/O pins.
- 24 I/O pins can be handled with just 5 I/O (clock + latch + 3 data) with 3 shift registers
- Having built SNES controllers with 2 shift registers each, I know that they run about 30 cents apiece…
- $0.87 + $0.90 < $2.43… we have a winner!
(I may make an ATMega8515 version also, because the code won’t be much different, and it is easy enough to do…)
Now, admittedly, this board would look downright simple if I had used the ATMega8515. It has 32 I/O, and I could have just routed all the pins directly. No fun at all. Plus it’d end up diagonal, because a 40-pin DIP part won’t fit in Seeed Studio’s 5x5cm limit. Not ideal. So I decided to go this route, which is maybe also not ideal, but oh well. As you can see, the DB9 connectors for the Genesis controllers are solder-cup parts that will sit at the edge of the board. This is useful, because they will also function as board standoffs, so it can be mounted in some little metal case without much worry of shorting anything.
I may also make this compatible with SMS/Mark III pads if I find an inexpensive enough way to get my hands on one to try, but I wouldn’t hold my breath
I think C64 joysticks used a similar pinout as well, so with some work, they might also function with this adapter.
I’m getting relatively close to making another order from Seeed Studio’s Fusion PCB service. One of the boards I’d like to have made is the Little Wire. The problem is, it’s so little, it seems like a bit of a waste to only get a board that size made. So, I thought about other things I can get alongside it and stay within 50mmx50mm, and didn’t come up with much. Then I remembered that I had intended to clean up the 5nes5snes design and post the files. I still intend to do that, but for the moment, I want to get some boards made!
The 5nes5snes-tiny differs from the 5nes5snes (and its 4nes4snes counterpart) in the following ways:
- It’s tinier (duh). It’s slightly under 34x50mm instead of the original 50×50 (1/3 smaller!)
- It uses an ATTiny84A. This is a much cheaper and physically smaller part with just enough I/O and flash to handle this project.
- It runs different code (again, probably obvious)
- It doesn’t have the spare GPIO and other features that the original 5nes5snes did
Other than that, it’s the same as the earlier 5nes5snes I posted earlier. Still allows 5 controllers with 8 buttons each or 4 controllers with 12 buttons each.
When I make the code changes for this one (it’s not up and running yet), I’ll port the latest code from the 4nes4snes project as well, so both versions of 5nes5snes will also have the Tribal Tap support (read over at the 4nes4snes page for further details on that).
If you’re interested in running the 4nes4snes on Arduino hardware, go to my previous post for the source code to get it running on ATMega168 (or ATMega88/ATMega328). It’s not Arduino code, but it will work on any Arduino based on any of those chips and brings out enough GPIO.
As far as I know, this is a project that no one else has done before… more details when the prototype is built! If you have an idea what this is, leave a comment!
EDIT: I thought some of the ICs were labeled (they are in my layout tool). The surface-mount part in the middle is an ATMega8535. The other ICs are ones I’ve used before in other posts…
English
日本語










Stuff People Have Said