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?

Testing Gameboy input voltage ranges

July 22nd, 2009

Testing Gameboy input voltage ranges - test rig


Recently there was a discussion about on 8bc about a new way of backlighting DMG’s. Bonewire’s backlighting method replaces the batteries with two 9V batteries. This raised the discussion of whether you could power the Gameboy directly with a 9V battery, or whether it would explode/otherwise fail.

I wrote a post about the inner workings of the regulator and promised to come back with some more measurements of the performance of the regulator at different voltage levels.

To clear possible confusion: One important aspect of the regulator is that it’s a switching type regulator which is using a feedback mechanism to keep the voltage steady. Because of its design it’s able to do so whether the input voltage is lower or higher than the target voltage of about +5V. Thus, the input voltage may vary, while the output voltage stays (relatively) constant. This is useful for battery operation since the batteries can used as long as they are able to give enough current, whether or not their voltage is low. Switching power regulators, in general, also have a power conversion ratio: Little energy is lost in the conversion. (As opposed to a linear regulator, like the 7805 & co, which are guranteed to wate at least a certain amount of energy as heat)

Test Conditions

The goal of the test is to benchmark the input voltage range at which a Gameboy power supply would work at. The test subject was a DMG-CPU-7 revision motherboard with a DC CONV DMG converter. (There are at least two versions of the regulator board; the other one is marked DC CONV 2 DMG and has a couple more components on it.)
I used a xzakox type flash cartridge loaded with LSDj, playing a melody, with power save set to off.

Here a few notes on the measured values:

  • Vin was adjusted in steps of 0.5 V and 1.0 V. The value is accurate to ±10 mV for all it matters
  • Vout was measured with a multimeter and is accurate.
  • Iin is the input current as displayed by the power supply unit, and is fairly inaccurate. (It only shows the general tendency)
  • DC/DC control RMS/f This value is also a bit hit and miss. I tried to read out the frequency which the DC/DC converter was working at, from the oscilloscope, to the best of my ability. This value fluctuated a lot, and is also just there to give a general picture of the freqeuncy. At the lower values the oscilloscope was unable to detect the frequency at all.
    That is what the cryptic RMS voltage is there for. It should give a rough idea of the duty cycle of the control wave.
  • Notes These are my observations for some of the voltages.

Test Data

Vin (V) IIn (A) Vout (V) DC/DC control RMS/f Notes
1.5 0.15 4.79 ~2.1V Prone to crash, no sound, DC/DC buzz on startup
2.0 0.12 4.82 ~2.4V No sound
2.5 0.11 4.84 ~2.7V Display will lose data when playing sound
3.0 0.05 4.87 ~3.0V/~260kHz Appears to work normally, possibly a bit glitchy/unstable
3.5 0.06 4.86 ~3.2V  
4.0 0.05 4.87 ~3.5V/~300kHz Fully normal operation
5.0 0.05 4.88 ~3.5V/~320kHz  
6.0 0.04 4.89 ~3.6V/~390kHz  
7.0 0.04 4.89 ~3.6V/~415kHz  
8.0 0.04 4.90 ~3.6V/~460kHz  
9.0 0.03 4.90 ~3.7V/~500kHz  
10.0 0.03 4.90 ~3.7V/~510kHz  
11.0 0.03 4.89 ~3.0V/~700kHz??  
12.0 0.03 4.89 ~2.6V/???  

Observations and conclusions

Low voltage operation

The first interesting observation is the behavior in the low end of the voltage spectrum. The regulator could manage to keep the CPU alive at an input voltage as low as 1.5V. However, at that voltage there were significant power losses in the conversion, sound wouldn’t work and the Gameboy would crash easily.
At the transition 2.5V->3V you can see a significant change in input current, and I also noticed a change in behavior on the oscilloscope. I’d define 3V as the absolute minimum voltage that the regulator board can handle stable.
Sidenote: This possibly opens the door for using a Li-Ion battery for powering a DMG.

Normal voltage operation

At 4.0 V the Gameboy is definitely operating normally. As the input voltage is increased, the switching frequency is increased of the regulator is increased. No abnormal behavior. At no point during the testing did I notice and excessive heat production in the regulator circuit.

Above-normal voltage operation

4 AA batteries can not reasonably produce voltages higher than 7 V, so anything above that could be seen as outside the standard range of operation.
So what are the effects of voltages above 7 V? The regulator itself seems to handle it fairly well. And the +5V output only fluctuates 100 mV, so the CPU won’t be affected. However, while the +5V is regulated, the -18V line used by the LCD is not directly regulated, but instead current limited by a 510 Ohm resistor.

It is possible that the increased input voltage will also increase the LCD voltage in such a way that it damages the LCD. The Gameboy I used for testing already had a slightly damaged display, but when I was done wih the testing its display was more or less completely broken (would turn off or glitch out within seconds after turning on the power, regardless of input voltage)

I tried feeding my known good Gameboy with 9V for a few minutes, with a moderate contrast setting, without any problems. However, it’s possible that the extreme positions of the contrast dial will slowly destroy the LCD, when the input voltage is >7 V. If so, it could probably be fixed by changing the control voltage range for the contrast dial.

I’ll have to investigate that further, but my preliminary conclusion is that you can feed the Gameboy with a 9V battery without problems.

Soup is better than twitter

July 18th, 2009

Or at least I think so. Or maybe I just have something against Twitter. Anyway, check my soup, and maybe subscribe to my RSS feed there too. I’ll be posting little links and stuff there, probably more often than I post stuff here.

Arduinoboy for Arduino Pro Mini 5V (PCB giveaway!)

July 5th, 2009

Arduinoboy for Arduino Pro 5V, Semi-equipped, back Arduinoboy for Arduino Pro 5V, Semi-equipped, front

Arduinoboy for Arduino Pro 5V, (Almost) fully equipped, front

So this is my version of an Arduinoboy board which, unlike other designs (?) is using an Arduino Pro Mini as the base, SMD resistors and capacitors instead of hole mount ones and is using screw terminal blocks for external connectors.
I’ll share the design of it as soon as I’ve straightened out a couple of small design errors. The two-terminal blocks have small pins that are supposed to go through a hole in the PCB for added stability. I drilled these extra holes even though some of them destroyed copper leads. (That’s what the patch leads are for in the upper left picture) The LED’s are also a bit to close to each other.

I’ll redesign the board and etch a new board with the fixes. But I’ve already etched two boards with the old layout, and I was going to trash one of them, but if anyone is interested, I can send it to you at the cost of the shipping. The board is equipped with as shown in the upper pictures. I’ll also add the pin headers needed to connect the Arduino to the board. I can also attach (relatively low-intensity) LEDs. NO peripherals are included, so you’ll need an Arduino Pro Mini 5V, 6N138, a link cable, power supply (Unless you did the Taco-04 Taco swap mod), MIDI jack and a button if you want that functionality.

If you’re interested, leave a comment or mail me (My e-mail address should be visible below)