gotchas: * wrong atmega328 (need atmega328p-pu, not atmega328-pu) (though this can still be used) * need fuse bits set separate from programming hex (pickit w/pics on the other hand handles this all in one) * need lock bits set * need 16MHz crystal when programming hex and lock bits (can use one from uno board) quick guide: set proper wiring on avr dragon (see image in pics) set fuse bits avrdude -b 19200 -c dragon_isp -p m328p -v -e -U efuse:w:0xFD:m -U hfuse:w:0xDE:m -U lfuse:w:0xFF:m add crystal, load hex, and program lock fuse avrdude -b 19200 -c dragon_isp -p m328p -v -e -U flash:w:hexfilename.hex -U lock:w:0x0F:m hexfilename.hex - the optiboot loader is included in arduino-1.8.5/hardware/arduino/avr/bootloaders/optiboot_atmega328.hex for more details, and references, see notes