[Jamie] built his own USB connected arcade controller. We’ve been seeing a lot of these lately, and they usually involve soldering buttons to a keyboard PCB. But [Jamie] decided to go a different route and use his own microcontroller. This method always gets a bit hairy when it comes to deciding how to connect it to a computer. Dealing with the USB stack used to be quite tricky, but the LUFA project is slowly taking the pain out of the process.
The Lightweight USB Framework for AVRs is an open source project that handles the hard work associated with USB capable AVR microcontrollers. [Jamie] knew that they already had a sample implementation of a hardware joystick. He’s not using one of the supported boards and so wasn’t able to just compile and go. But porting the code to work with his minimus board was simple enough. With the code in place, the physical build was quite simple. The buttons and joystick were mounted on the surface of an overturned drawer. Each is connected to one pin of the controller board and to ground. LUFA makes sure that the device enumerates as a joystick, and [Jamie] was gaming in no time.
My only suggestion would be to lay out the buttons in a more ergonomic fashion. Other then that this looks like an excellent alternative to hacking a keyboard for a mame cabinet controller and probably a bit cheaper too.
Because that’s how the originals were?
They were only straight layout in USA and those button spacings look way too wide even for that.
I couldn’t decide on how to work out an ergonomic layout that would look good, so just kept them straight. Still works quite nicely though. The buttons are widely spaced because I have mammoth hands :)
If you ever decide to revise the the button placings this site has all the details http://www.slagcoin.com/joystick/layout.html
LUFA and the USB AVRs are great, I love that LUFA is open. I use the virtual serial bit in programs all the time, and the microcontroller is cheaper than a bloody ftdi chip. :)
I’m in the middle of doing the same thing. Also with a minimus. I’m doing it as a custom HID keyboard, with 20-key rollover. 10 times better than hacking a keyboard. No need to worry about key blocking for larger button layouts!
What does LUFA offer over V-USB?
LUFA is for AVRs that have *hardware* USB. V-USB, USBtiny, et al, are software implementations for AVRs without USB.
Dean Camera (the creator of the LUFA libraries) he is an absolute great guy, and if you post on the AVRfreaks forums he will help you with any problems you have. Including rewriting portions of code.
Also the hardware USB just works!
vUSB is a software-only, low-speed implementation. LUFA is a driver for the AVRs that have hardware USB and can do high-speed USB.
yes, but the question was what are the benefits? paying more for AVR with hardware USB is not a benefit.
Top-drawer stuff, this.
Is this not what a Teensy was intended for?
Perhaps, but Teensy is not open source, which is a problem for some.
The smaller Teensy is basically identical to the Minimus, ~same breakout circuit, ~same processor.
However, the Minimus is pre-programmed with AVR’s default bootloader, which is nicely supported under linux. Teensy looks like it uses a proprietary bootloader / uploading code. It’s also a lot easier to get hold of in the UK.
You can buy purpose made interfaces to do this, they’re popular when making MAME cabinets and controllers.
Save yourself a few days and buy this kind of thing http://www.ultimarc.com/ipac1.html
I prefer the toodles Cthulhu to the ipac
http://www.godlikecontrols.com/order.html