Starting Electronics Needs Your Help!
It is that time of the year when we need to pay for web hosting and buy new components and equipment for new tutorials. You can help by making a donation. Contribute to this website by clicking the Donate button. The total will be updated once daily. (You may need to clear your browser cache to see the updates.)
Target Amount: $2000
Amount Raised: $1061
Top Donor: C.C. $100
Created on: 13 October 2012
Updated on: 27 February 2016
If your Arduino Uno microcontroller has been damaged or got "bricked up" and you need to get it working again quickly, you will need to replace the microcontroller chip (ATMEGA328P) and then load the bootloader program to the microcontroller. Although there are ways of restoring a "bricked up" microcontroller, a quick fix to get your Arduino Uno board working is to replace the microcontroller and then sort out the bricked up microcontroller at your leisure.
When a new blank microcontroller is inserted into an Arduino board, it must have the Arduino bootloader programmed into it. This only has to be done once. The bootloader is a piece of software that allows sketches to be loaded to the Arduino via the USB or serial port from the Arduino IDE.
This video shows what needs to be done to load or "burn" the bootloader to the blank microcontroller in an Arduino Uno board. Atmel Studio 6 and the AVRISP mkII USB programmer is used to burn the bootloader. The rest of this tutorial covers the details.
Can't see the video? View on YouTube →
If you have loaded Atmel Studio on your PC and you try to burn the bootloader to the Arduino using the Arduino IDE, you will get an error message in the Arduino IDE because of a driver clash between Atmel Studio and the Arduino IDE drivers.
The Arduino IDE displays the error message:
Error while burning bootloader.
avrdude: usbdev_open(): did not find any USB device "usb"
The best solution to this problem is to use Atmel Studio to burn the bootloader, rather than removing Atmel Studio and its drivers.
Plug the AVRISP mkII USB connection into a spare USB port on the PC. Plug the AVRISP ribbon cable connector into the 3 by 2 header on the Arduino board. Make sure that you connect it the right way around. Pin 1 is marked on the AVRISP connector and on the Arduino header.
Power up the Arduino either from the PC via a USB cable or by an external power supply.
The bootloader is included with the Arduino IDE software. In version 1.0.1 of the Arduino software, you will find the bootloader in the Arduino folder:
The bootloader in this folder that must be loaded to the Arduino Uno is optiboot_atmega328.hex
1. Connect the hardware as described above
2. Start Atmel Studio
3. In Atmel Studio, click Tools → Device Programming
4. In the Device Programming dialog box, select AVRISP mkII in the Tool drop-down box, ATmega328P in the Device drop-down box and ISP in the Interface drop-down box
5. Click the Apply button
6. You can click the Read button under Device signature to make sure that you can connect to the ATMEGA328P microcontroller
7. Click Memories in the left pane of the dialog box
8. Browse to the bootloader hex file using the ... button and then select the hex file
9. Click the Program button
10. After programming has finished, click Fuses in the left pane
11. Change the fuse values to:
12. Click the Program button
13. You can now close Atmel Studio
14. Start the Arduino IDE and load a sketch to test that the bootloader is working, e.g. load the Blink sketch to flash the on-board LED
The following related articles show how to connect a programmer (AVR Dragon and AVR ISP mkII) to an Arduino board and restore the bootloader using Atmel Studio 7 on an Arduino Uno and Arduino MEGA 2560.