Burning a bootloader
If you just want to upload the bootloader to one or two chips don't spend your time.
Better buy chips with preprogrammed bootloaders.
With the blank ones, you save only a few Euros per chip.
- On programming bootloaders you will have to insert and remove chips a number of times.
When shipped their pins look slightly trapezoidal.
To insert the chip onto a socket you have to make them look parallel. But take care doing it.
Also, there are tools doing that job.
When inserting take extra care where pin number 1 should go.
- Also take care when removing a chip from the socket. A sharp screw driver might help.
A short field report
If you are going to upload the bootloader to a large number of chips (e.g. for your students) the following procedure is recommended:
- 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.
- 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.)
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.
Use 3 Arduino boards.
- one for the sketch ArduinoISP to transfer the bootloader (the programmer shown at the bottom of the picture)
- one to insert the blank ATmeg328P (shown at the top of the picture. This board is not connected to any PC!)
- 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.
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.
⇒ Tools ⇒ Programmer ⇒ Arduino as ISP
By clicking Burn Bootloader the burning will start. There is no more start button.
⇒ Tools ⇒ Burn Bootloader
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.
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).
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.