Interfacing a Retro Controller using the USBASP

An ISP dongle is a very common piece of equipment on a maker’s bench. However, its potential as a hackable device is generally overlooked. The USBASP has an ATmeg8L at its heart and [Robson] decided that this humble USB device could be used as an interface between his PC and a SNES Joypad.

A SNES controller required three pins to communicate with a host: clock, data and latch. In his hack, [Robson]  connects the controller to the ISP interface using a small DIY adaptor and programs the AVR using the V-USB library. V-USB is a software USB library for small microcontrollers and comes in pretty handy in this instance.

[Robson] does a pretty good job of documenting the entire process of creating the interface which includes the USB HID code as well as the SNES joypad serial protocol. His hack works on both Windows and Linux alike and the code is available on GitHub for download.

Simple implementation like this project are a great starting point for anyone looking to dip their toes in the DIY USB device pool. Veterans may find a complete DIY joystick more up their alley and will be inspired by some plastic techniques as well.

Smallest MIDI Synth, Again!

Not content with fitting a tiny square-wave MIDI synthesizer into a MIDI plug, [Mitxela] went on to cram a similar noisemaker into a USB plug itself.

Besides being physically small, the code is small too, as well as the budget. It uses V-USB for the USB library running on an ATtiny85, and a couple of passive parts. His firmware (apparently) takes in MIDI notes and spits out square waves.
Continue reading “Smallest MIDI Synth, Again!”

Dirt-Cheap USB Arduino Hack From the Past

Mass production is a wonderful thing. Prices fall, and hobby hackers get cheap gear. The mind then wanders towards what can be done with it. So it’s little wonder that someone like [Aaron Christophel] would try to repurpose those sub-$3 AVR programmers that are all over eBay (translated poorly out of German here, but demonstrated in the video embedded below).

[Aaron] didn’t have to do much, really. The only trick is that you’ll first need to re-flash the existing ISP firmware with one that lets you upload code to the device itself over USB. If you don’t have an Arduino on hand to re-flash, buy at least two of the cheap programmers — one to program the other ones. Once you’ve done that, you have essentially an Arduino with limited pinout and two onboard LEDs, but in a nice small form-factor and with built-in USB. [Aaron] even provides an Arduino boards.txt file to make it all work smoothly within the IDE.

Continue reading “Dirt-Cheap USB Arduino Hack From the Past”

Converting A GameCube Controller To USB

The GameCube controller is a favorite among the console enthusiasts new and old, and with Nintendo’s recent release of the Smash Bros. edition of this controller, this is a controller that has been in production for a very, very long time. [Garrett] likes using the GameCube controller on his PC, but this requires either a bulky USB adapter, or an off-brand GameCube ‘style’ controller that leaves something to be desired. Instead of compromising, [Garrett] turned his GameCube controller into a native USB device with a custom PCB and a bit of programming.

First, the hardware. [Garrett] turned to the ATtiny84. This chip is the big brother of the ubiquitous 8-pin ATtiny85. The design of the circuit board is just under a square inch and includes connections for the USB differential pairs, 5V, signal, and ground coming from the controller board.

The software stack includes the micronucleus bootloader for USB firmware updates and V-USB to handle the USB protocol. There are even a few additions inspired by [Garrett]’s earlier shinewave controller mod. This controller mod turns the GameCube controller into a glowing hot mess certain to distract your competitors while playing Super Smash Bros. It’s a great mod, and since [Garrett] kept the board easily solderable, it’s something that can be easily retrofitted into any GameCube controller.

ATtiny85 Data Acquisition


The folks at Ivmech recently had a need for some new hardware. They needed a small, cheap device able to sense some analog values, toggle a few digital pins, and log everything to a computer. What they came up with is the IViny, an extremely small data acquisition device built around the ATtiny85, capable of logging data to a computer.

The IViny features two digital channels and two 10 bit analog channels, just like you’d find in any ATtiny85 project. Power is supplied over USB, and a connection to a computer is provided by V-USB. There’s also a pretty cool Python app that goes along with the project able to plot the analog inputs and control the digital I/O on the device.

It’s not exactly a fast device – the firmware only supports 100 samples per second, but an upcoming firmware upgrade will improve that. Still, if you ever need to read some analog values or toggle a few pins on the cheap, it’s a nice little USB Swiss army knife to have.

USB On The ATtiny10

Atmel’s ATtiny10 is their smallest microcontroller in terms of physical size – it’s an SOT-23-6 package, or about the same size as surface mount transistors. The hardware inside this extremely bare-bones; three I/O lines, 1kB of Flash, 32 bytes of RAM, and a reduced AVR core with 16 registers instead of 32. With such a minimal feature set, you would think the only thing this micro would be good for is blinking a LED. You’d be right, but [cpldcpu] can blink a LED with the ‘tiny10 over USB.

The V-USB interface usually requires about 1.5kB of Flash in its most minimal implementation, and uses 50 bytes of RAM. This just wouldn’t do for the ‘tiny10, and although [cpldcpu] is working on a smaller, interrupt-free V-USB, there were still some hurdles to overcome.

The biggest issue with putting code on the ‘tiny10 is its reduced AVR core – on the ‘big’ 32-register core, direct memory access is two words. On the ’10, it’s only one word. AVR-GCC doesn’t know this, and no one at Atmel seems to care. [cpldcpu] worked around this problem using defines, and further reduced the code size by completely gutting V-USB and putting it in the main loop.

It’s not much, but now [cpldcpu] can blink an LED with a ‘tiny10 over USB. If you’re wondering, 96.4% of the Flash and 93.8% of the SRAM was used for this project.

Interrupt Free V-USB


[Tim’s] new version of Micronucleus, Micronucleus 2.0, improves upon V-USB by removing the need for interrupts. The original Micronucleus was a very small implementation of V-USB that took up only 2KB. Removing the need for interrupts is a big leap forward for V-USB.

For those of you that do not know, “V-USB is a software-only implementation of a low-speed USB device for Atmel’s AVR® microcontrollers, making it possible to build USB hardware with almost any AVR® microcontroller, not requiring any additional chip.” One tricky aspect of using V-USB is that the bootloader requires interrupts, which can lead to messy problems within the user program. By removing the need for interrupts, Micronucleus 2.0 reduces the complexity of the bootloader by removing the need to patch the interrupt vector for the user program.

With the added benefit of  speeding up the V-USB data transmission, Micronucleus 2.0 is very exciting for those minimal embedded platforms based on V-USB. Go ahead and try out Micronucleus 2.0! Leave a comment and let us know what you think.