MIDget board
MIDget is a simple, inexpensive sensor interface based on the AVR ATTiny26. In its current incarnation, 8 of the 11 available ADC channels are used. This means that you can connect up to eight sensors, knobs, or whatever to the board. The MIDget sends the 10-bit ADC value as 2 separate MIDI CC messages (1 for LSB, and 1 for MSB). This allows you to bypass the 7-bit resolution limitation inherent to MIDI CC messages for projects that require greater sensitivity. These 2-byte messages can be put back together inside of MaxMSP.
Since the ATTiny26 lacks a proper UART (just has USI), a software implementation based on the Atmel AVR307 application note was used. Since this code was written for the IAR Compiler, I had to port it to work on AVR-GCC. Once this was completed, it was fairly easy to get MIDI messages sending from the chip.
Getting the ADC code to work was a little more tricky. I was originally using the Procyon “a2d” functions, but for some reason these were not working for me. So, I spent a bit more time and worked out my own ADC functions that turned out to be much smaller and efficient code than Procyon. It’s nice to actually understand how that stuff works instead of just taking advantage of a pre-made function library.
I’m still working a couple of bugs out of the circuit, but in the end the circuit itself should cost less than $10us to build. Download Source Code(gcc).