« hari's tb2 | Main | board 02 mistakes »

on cooking your jtag cable

As it turns out the power traces on board 02 are a bit close together. If you are clumsy (as I am) and damage the adjacent power and switch pins on the LM2676 such that they short, vcc goes from 5 to 10 volts and you have a bad day. The silver lining of this cloud is I finally had to figure out putting a bootloader on the mega32. This is how.

First, wire your AVR directly to a parallel port as described here. Basically, on a DB25, 1=SCK 2=MOSI 11=MISO, 16=RESET, 18-25ish=GND. Then do this:
uisp -dprog=dapa -dpart=ATmega32 --wr_fuse_h=D8 --wr_fuse_l=DF
uisp -dprog=dapa --erase --upload --verify if=stkload_m32_2k32k_16000000.hex
uisp -dprog=dapa --wr_lock=EF
The hex file comes from here. These steps set up the fuses correctly for a R02 board, write a boot loader to the 2kw boot section, and set up the lock bits so the app cannot overwrite it accidentally with the SPM (store-program-memory) instruction.

Then, assuming you are using your first usb serial port, upload code by pressing the reset button and then running this within a few seconds:
uisp -dprog=stk500 -dpart=ATmega32 -dserial=/dev/ttyUSB0 if=main.hex --upload --verify
You need to reset again afterwards because it will not come out of program mode on its own. Theoretically speaking this should make the board Arduino-compatible, but it didn't work on the first try (probably a slightly different bootloader) and I'm not really worried about spending time on that now.

TrackBack

TrackBack URL for this entry:
http://robotarmy.org/cgi-bin/mt/mt-tb.cgi/21

About

This page contains a single entry from the blog posted on November 19, 2007 11:33 PM.

The previous post in this blog was hari's tb2.

The next post in this blog is board 02 mistakes.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.35