Hacking an AVR programmer to function as a USB MIDI interface

This is going to be a quick post (compared to the average post here).

I recently was in need of a USB to MIDI adapter, wanted to test a midi implementation on a ATmega8 and also check out VCV Rack with my keyboard, which is pretty old and only has a legacy MIDI connection. I didn’t have a USB to MIDI adapter, and was not so keen to buy one anyways, so I set out to find the easiest USB MIDI implementation I could build in a afternoon.

Later, after some searching, I found this project by Yoshitaka Kuwata on the V-USB website. It is a USB MIDI IN and OUT adapter running on an ATtiny micrcontroller, as expected, by making use of V-USB. With some tweaking I could modify the code to run on a USBASP.

If you have not been introduced, the USBASP is an AVR programmer. Therefore, it is used to load code into AVR microncotrollers, like the Atmegas used on Arduinos. It uses V-USB, a software implementation of USB, as the ATmega8 it uses does not have native USB. I have used it as a USB adapter for SNES controllers before. They are very cheap, going as low as two US dollars or less on eBay. A good thing is that the serial (UART) pins, needed by the Legacy MIDI protocol, are already broken out to the connector.”

Link