[Robson Couto] recently found himself in need of MIDI interface for a project he was working on, but didn’t want to buy one just to use it once; we’ve all been there. Being the creative fellow that he is, he decided to come up with something that not only used the parts he had on-hand but could be completed in one afternoon. Truly a hacker after our own hearts.
Searching around online, he found documentation for using an ATtiny microcontroller as a MIDI interface using V-USB. He figured it shouldn’t be too difficult to adapt that project to run on one of the many USBASP programmers he had laying around, and got to work updating the code.
Originally written for the ATtiny2313, [Robson] first had to change around the pin configuration so it would work on the ATmega8 in the USBASP, and also updated the USB-V implementation to the latest version. With the code updated, he programmed one of the USBASP adapters with a second one by connecting them together and putting a jumper on the J2 header.
He had the software sorted, but there was still a bit of hardware work to do. To provide isolation for the MIDI device, he put together a small circuit utilizing a 6N137 optoisolator and a couple of passive components on a piece of perf board. It’s not pretty, but it does fit right into the programming connector on the USBASP. He could have fired up his PCB CNC but thought it was a bit overkill for such a simple board.
[Robson] notes that he hasn’t implemented MIDI output with his adapter, but that the code and the chip are perfectly capable of it if you need it for your project. Finding the schematic to hook up to the programmer’s TX pin is left as an exercise for the reader.
If you don’t have a USBASP in the parts bin, we’ve seen a very similar trick done with an Arduino clone in the past.
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.
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!”
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”
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.
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.
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.