Sunday, March 15, 2009
Evil Mad Scientists
Elizabeth and I wanted an excuse to try out the sweet MeggyJr kit from the Evil Mad Scientists Labrotories (EMSL). She has invented a game called Light and Heavy that MeggyJr will be perfect for.
The kit is fantastic, by far the best electronics kit I have ever built. Extreme care has been taken to maximize your probability of a successful build. The detailed color instructions are included with the kit so you won't have to print those out when the kit arrives. A careful read through before you start might save you hours in the long run, so just do it even if you think you already "get it". Every couple of steps, EMSL include full color pictures of the board so far, which adds reassurance.
If you happen to miss something in the instructions, additional hints are stencilled on the board itself "J1 Other Side" for instance.
The parts are easy to find in ZipLock bags with the step number clearly printed on the outside. And the parts themselves are well chosen and of high quality and should stand up to some hard gaming.
For future designs, I'd like to see sockets for the ICs, they get soldered directly to the board. Also, the way the screen sits the electrolytic capacitor is a bit awkward. They were obviously trying to keep MeggyJr as thin as possible.
When we powered her up for the first time, MeggyJr loaded Attack of the Killer Tomotoes, but the blue LEDs on a single row did not function. Careful inspection of the LED headers revealed scant solder on a couple of the pins which was easily remedied.
That said, how could I have possibly soldered the TTL programming interface in the wrong way? Anyway I did, and to make matters worse, my iron got switched off about the time I discovered the renegade part. So I ripped out all of the vias (through hole copper) along with the part (I know).
So I'm disappointed, but know EMSL were kind enough to provide two programming methods. So I figure, I'll test out the ISP programming header first. This works! and we can compile games in arduino and burn the games using avrdude by hand. As a fall back, it's great.
(NOTE FROM EMSL: First, for the record of folks reading this in the future: DO NOT go deleting the bootloader just because you don't know what else to do.)
So, relieved that all is not lost, I return my attention to the TTL header. Testing the connections reveals that all but pin 5 are not functional. I add jumpers based on the most excellent schematic EMSL have provided.
Now that all connections are in order, I need to replace the bootloader on the processor. I had no idea this would be so difficult! One issue is that the arduino IDE does not automatically work with mega-isp, an awesome adruino script that allows your arduino to operate as an avrisp, and the only way I have to upload the bootloader. It took a while to get the right combination of lock and fuse bits but I finally got avrdude to do the dead. Elizabeth and I literally jumped up and down when we loaded MeggyJr_FroggyJr via the TTL port. Here is the script that finally worked.
OPTS="-c avrisp -p m168 -P /dev/ttyUSB0 -b 19200"
avrdude $OPTS -U efuse:w:0x00:m -U hfuse:w:0xdd:m -U lfuse:w:0xff:m
avrdude $OPTS -U lock:w:0x3f:m
avrdude $OPTS -U flash:w:ATmegaBOOT_168_diecimila.hex:i
avrdude $OPTS -U lock:w:0x0f:m # this was the culprit