Burning a bootloader


Preliminary notes:

A short field report

  1. Tried it using an Atmel evaluation bord serval times. Taking 3 minutes for WRITE and onother 3 minutes for VERIFY. Always got a Verify error. So I gave it up.
  2. When you check out Using an Arduino as an AVR ISP (In-System Programmer) on the bottom of the page they show how to upload the bootloader using an Arduino board plus a breadboard. Didn't work either.

    Update: double-check everything twice. Now it works. (By mistake the pull-up resistor to the RESET pin was connected to Gnd instead of +Vcc.)


  3. So I tried the first option given on Using an Arduino as an AVR ISP (In-System Programmer) using two Arduino boards. It worked immediately. And each and every time since then.
If you are going to upload the bootloader to a large number of chips (e.g. for your students) the following procedure is recommended:

Use 3 Arduino boards.

  1. one for the sketch ArduinoISP to transfer the bootloader (the programmer shown at the bottom of the picture)
  2. one to insert the blank ATmeg328P (shown at the top of the picture. This board is not connected to any PC!)
  3. one to connect to a second PC to transfer the Blink.ino sketch to verify the upload of the bootloader was successful. Once you have uploaded the bootloader to a new ATmega (step 2) insert it to this board to check if it works as expected.

Workflow

Don't expect a Youtube video, just read the instructions.

If your Arduino IDE is not set to the English language just do so now. It will make it more easy to follow the 7 steps given on http://arduino.cc/en/Tutorial/ArduinoISP.
With recent Arduino IDEs you can omit step 2, they have done it for you. Also step 5 (the capacitor) was not needed.
Step 7 turns out to be two steps:
As the standard programmer will be desected better take down a note what it was (probably AVRISPmkII). So you can restore it after you finished.

By clicking Burn Bootloader the burning will start. There is no more start button.

The end of the programming is signalled by the LEDs and the status line in the IDE.

After having programmed and tested all your chips you can the select the standard programmer again.

Safety first:
Before inserting and removing the chip better remove the power. Either by removing the USB plug (yes you can). Or insert a small switch in the cable connected to the power supply between board (1) and board (2).

Good news:
Microcontrollers have fuses. And it's no fun to handle them. When shipped the HFUSE byte is set to 0xD9, and the LFUSE byte is set to 0x62. When a bootloader is installed the fuses should be set to 0xDE and 0xFF (some have (0xDA and 0xFF). The sketch you are using transfers the fuses to the new chip - so you have nothing to do.


contact: nji(at)gmx.de