Fixing Gameboy-powered Arduinoboy MIDI glitches

July 26th, 2009

I recently had a little problem when building my Arduinoboy. The Arduinoboy did appear to work, but it was glitchy. Some MIDI notes were ignored or gave strange results, and sync didn’t appear to work at all. I sat down and compared trash80’s schematic to other MIDI 6n138 schematics and I noticed something: There was not resistor between pin 7 and ground in trash80’s schematic, which is is otherwise common in MIDI optocoupler circuits.

Arduinoboy MIDI fix - Before Arduinoboy MIDI fix - after

Left: Before, Right: After. Upper waveform: Test signal source, Lower waveform: Opto-coupler output. Both powered by the Gameboy.

So I set up a prototype circuit with a test signal of 32 kHz to see if I could trace the problem. It turned out that the problem only happens when you power the Arduinoboy from the Gameboy. When powering it with +5V it worked alright and the oscilloscope output looked ok. However when powering it from the Gameboy, the combined losses from the lower output voltage from the Gameboy (The DC/DC only outputs 4.8 V as shown in the previous post) the protection diode at the Gameboy’s link port and trash80’s way of driving the 6n138 resulted in a source voltage of 4V for the 6n138 which made the rise time way to high, as you can see in the left picture.

Adding a 4.7k resistor between pin 7 of the 6n138 and ground decreased the rise time enough to make the circuit work flawlessly. So if you’re having problems with a Gameboy-powered Arduinoboy, try this. Fixed version of trash80’s schematic provided below.

Arduinoboy MIDI fix - schematic

And finally a word of caution. Don’t confuse the 4.7k resistor with the 270 Ohm resistor. A 270 Ohm resistor with a 5% mark (gold strip) can look confusingly similar to a 4.7k resistor. Can you tell the difference below?

4.7k Ohms vs 270 Ohms - Can you tell the difference?