#!/bin/sh IPATH=`echo $0 | sed s/[^\/]*$//`; CMD="avrdude" OPTS="-p m168 -b 115200 -P usb -c avrispmkII " # Erase chip write lock and fuses $CMD $OPTS -e -V -U lock:w:0x3f:m -U lfuse:w:0xff:m -U hfuse:w:0xdf:m -U efuse:w:0x0:m # Upload bootloader code $CMD $OPTS -D -V -U flash:w:ATmegaBOOT_168.hex:i # Lock boot section $CMD $OPTS -V -U lock:w:0xcf:m