This is a tutorial that explains how to burn the bootloader on an Arduino Mega using Arduino UNO. You can do this when the board suddenly stops working after using the board for a while and also as a last resort to see if the new board you got is a faulty board.
- Arduino Mega 2560 as a target board x 1
- Arduino UNO as a programmer board x 1
- Jumper wires x 6
- USB 2.0 cable x 1
- PC with Arduino IDE installed
Burning the bootloader
Connect the Mega 2560 to a USB port on your computer.
In Arduino IDE; select
Tools > Board > Arduino AVR Boards > Arduino Mega or Mega 2560.
Select the port your board is connected to in
Tools > Port.
File > Examples > 11.Arduino ISP > ArduinoISP
Arduino IDE > Examples > 11.Arduino ISP > ArduinoISP
Click Upload to upload the sketch to the board.
Disconnect the Mega 2560 from the PC.
Connect the two boards as follows using the ICSP pins on each board:
|PROGRAMMER ICSP PINS||TARGET ICSP PINS|
Connect the Mega 2560 to your PC again.
Check the board and port selection like in step 2 and 3.
Tools > Programmer > Arduino as ISP.
Tools > Burn Bootloader.
The following confirmation message will show at the bottom of Arduino IDE if successful:
Please note that you can also connect the boards using the I/O pins on each board. For example, 1 - CIPO ICSP is internally connected to the same electric node as I/O PIN 12 and so on. So it doesn't matter which connection type you use (I/O pins or ICSP) as long as they follow one of the tables. The ICSP connector has 6 pins that are arranged as the diagram 2 shows (placing the UNO board so the ICSP label above the connector is straight as you would normally read it).
|PROGRAMMER PINS||TARGET PINS|
|PIN 11||PIN 51|
|PIN 12||PIN 50|
|PIN 13||PIN 52|