Home > AVR, Syhthe > Universal USB-MIDI board

Universal USB-MIDI board

Monday June 11th, 2012 morecat_lab

I designed a low cost USB-MIDI board named moco2. With moco2, one can easily build MIDI device which works with iPad.

Moco2 can be used as a converter between serial-MIDI and USB-MIDI.


1. Schematic

The schematic of moco2 is the same with USB-MIDI converter named ‘moco‘.

moco2 Schematic

When V-USB is used to implement USB-MIDI class device,  flash memory of 2KB in Tiny2313 is not big enough to implement many functions inside. Lately, Tiny4313 , which has 4KB flash memory, is available.  They have sufficient memory for many generic application. I decide to design a new PCB for moco for general use.

In the schematic, Tiny2313/4313 is driven by 16MHz clocked and a opto-couppler is attached for bridge Serial MIDI.

The new PCB for moco2 has a 18 PIN connector for general use. All ports of Tiny2313/4313 are assigned in the connector. Note that not all of parts should mount on the PCB, if one would not use the function. For example, no opto-cuppler is required if serial MIDI is not used.

2. Application of moco2 board

Various kinds of MIDI device can be implemented on moco2 board with different firmware.

The following are examples which I actually built for the test. Please note that tiny 2313 / tiny4313 have no bootloader function. We need to program them via ISP programmer.  Remember that the fuse bits should set properly to function as V-USB device.

2.1 USB-MIDI Serial MIDI converter ‘moco’

The following firmware works to bridge between USB-MIDI and serial MIDI. As I described in the previous section, no sufficient capacity exits on Tiny2313 and only one direction can be implemented in it.  You need to choose USB-MIDI -> serial MIDI or vice  versa. With Tiny4313, both direction will work simultaneously .

name of program function Required CPY
Mico Serial MIDI -> USB-MIDI Tiny2313
Moco USB-MIDI -> Serial MIDI Tiny2313
MicoMoco USB-MIDI <-> Serial MIDI Tiny4313

シリアルMIDIコンバータ もこ

Source code of these firmware is here.

2.2 Mini Keyboard

This is very simple keyboard with tactile switch. When one of the switch is shorted to ground, the corresponding note is sent to USB-MIDI.


As the limitation of PIN,  the switches are assigned just one octave.

note NO PIN
C4 PB1
C#4 PB2
D4 PB3
D#4 PB4
E4 PB5
F4 PB6
F#4 PB7
G4 PD0
G#4 PD1
A4 PD4
A#4 PD5
B4 PD6

Source code of this firmware is here.

2.3 Note LED Display

This application is to display the note in LED. When the MIDI note is sent to this device, the corresponding pin is set to HIGH.

A number of LEDs can be connected to these pins via appropriate registers .


Source code of this firmware is here.

3. Example

moco2 is designed to embedded as a part of MIDI device in mind.

I used to connect MeeBlip micro, which is OSS based digital synthe, with iPad.


Points of Modifications:

  • moco2 is used as USB-MIDI converter. Only USB->Serial MIDI function is requires, and a Tiny2313 is sufficient for the purpose. No Opto-couppler is required.
  • As MeeBlip has 5V voltage regulator on the board. moco can supply 5V from USB-BUS, which can directly connect Meeblip board. I removed  voltage regulator.
  • Signal for serial midi from moco2 can directly connected MeeBlip MIDI-IN without Opt-couppler on Meeblip PCB. However, I want to avoid unnecessary modification, and I just connect through Opt-Couppler.
  • MeeBlip micro can be software controllable, which means it can be used without any switch and knobs. The parameters of Meeblip can change with CC from MIDI.


  • I use TouchOSC to control the parameters of MeeBlip from iPad. With TouchOSC Editor on MacOSX , the design of User Interface, such as the size of button, the colors of those, and so on,  can customized.
  • For use with MeeBlip, a set of custom UI is supplied by an user. However, MIDI channel is set to 3 instead of 1.


Categories: AVR, Syhthe Tags:
Comments are closed.