Arduino Bootloader with STK500

I followed this tutorial to burn the Arduino bootloader onto an AVR ATMEGA8. The one thing that I didn't like was going through all of the AVR Studio menus, clicking checkboxes, etc. Instead, I just wanted a batch file that would do everything all at once.

So here it is:

1) Get the bootloader hex file onto your desktop or in a folder or something.
2) Create a new batch file in the same directory and open it to edit.
3) Type this:

: Set fuse bits, lock bits, voltages
D:\\STK500\\Stk500.exe -dATmega8 -ut5.2 -ua5.0 -!3686400 -lFF -L -fCADF -F
: Burn Arduino hex bootloader file
D:\\STK500\\Stk500.exe -dATmega8 -pf -e -vf -ifbootloader.hex 
: Lock it down
D:\\STK500\\Stk500.exe -dATmega8 -lCF -L

4) Change the code for your setup. First, where is your stk500.exe? It might not be on a D drive! Second, what is the hex file called? I changed the name of the file to be "bootloader.hex"
5) Attach your STK500 and plop in a new ATMEGA8, set it up like in the tutorial above...
6) And double click your batch file to run it.

If you want to learn more about the command-line options,
look at section 5.4 and 5.5 of this PDF
. I just implemented the steps from the tutorial above into the command-line language outlined in the PDF documentation.

If you use the "Bootloader Station" in the Senselab, then you only need to turn on the bootloader, drop in a chip, and double click.

Categories: |