diff --git a/content/Hardware/Core Boards/Burn-the-bootloader-on-UNO-Mega-and-classic-Nano-using-another-Arduino.md b/content/Hardware/Core Boards/Burn-the-bootloader-on-UNO-Mega-and-classic-Nano-using-another-Arduino.md new file mode 100644 index 00000000..02055b5b --- /dev/null +++ b/content/Hardware/Core Boards/Burn-the-bootloader-on-UNO-Mega-and-classic-Nano-using-another-Arduino.md @@ -0,0 +1,168 @@ +--- +title: "Burn the bootloader on UNO, Mega, and classic Nano using another Arduino" +--- + +The bootloader is a small piece of software that allows uploading of sketches onto the Arduino board. It comes preprogrammed on the microcontrollers on Arduino boards. Whether the bootloader has been corrupted or intentionally has been removed, it can be restored by _burning_ (also called, _flashing_ or _programming_) a new bootloader to the board. + +The easiest way to burn the bootloader to classic AVR boards (UNO, Mega, Nano, etc.) is using **a second Arduino board** as a programmer, which is the method that will be covered below. + +--- + +## Step 1: Connect the boards + +AVR boards are programmed with the SPI interface (COPI, CIPO and SCK signals). On many boards (including UNO, Mega, and Nano), these are available in two locations: + +* [The digital and power pins](#common-pins). These are the most commonly used pins on Arduino, and you'll only need six standard male-to-male jumper wires. +* [The ICSP header](#icsp). CIPO, COPI, and SCK are available in a consistent physical location on the ICSP header. You'll need female-to-female jumper cables for these pins. + +> **Note:** Although the “Arduino as ISP” only works for programming targets of the AVR architecture, you can use boards of any architecture as an “Arduino as ISP” programmer. Check the pinout diagrams in [Arduino Docs](https://docs.arduino.cc/) to find which pins to use for CIPO, COPI, and SCK. On some boards PIN 10 may not be available. In this case, change the line `#define RESET 10` to use a different pin. + + + +### Option A: Using the digital and power pins + +For each row in the table below, connect the programmer pin to the corresponding target pin. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PROGRAMMER BOARDTARGET BOARD
PIN 10RESET
COPI
UNO: PIN 11
Nano: PIN 11
Mega: PIN 51
COPI
UNO: PIN 11
Nano: PIN 11
Mega: PIN 51
CIPO
UNO: PIN 12
Nano: PIN 12
Mega: PIN 50
CIPO
UNO: PIN 12
Nano: PIN 12
Mega: PIN 50
SCK
UNO: PIN 13
Nano: PIN 13
Mega: PIN 52
SCK
UNO: PIN 13
Nano: PIN 13
Mega: PIN 52
5V5V
GNDGND
+ +When the boards are connected, you can proceed with [burning the bootloader in Arduino IDE](#ide). + +
+ Circuit Diagram. UNO and Nano connected with digital and power pins. +
Example: Using an UNO to program a Nano (digital and power pins).
+
+ + + +### Option B: Using the ICSP header pins + +![The ICSP header on Uno R3, Nano and Mega.](img/icsp-headers.png)_Note that the orientation of the header relative to the USB port is different on the Nano._ + +1. Connect every programmer ICSP pin except RESET to the equivalent ICSP pin on the target. +2. Connect PIN 10 on the programmer board to any RESET pin on the target. + +
+ Circuit Diagram. UNO and Mega connected with ICSP pins. +
Example: Using an UNO to program a Mega (ICSP pins).
+
+ +--- + + + +## Step 2: Burn the bootloader in Arduino IDE + +Now that the board connections are set up, we can use Arduino IDE to burn the bootloader. + +01. Open Arduino IDE. + +02. Connect the **programmer board** to the computer. + +03. Select your programmer board in _Tools > Board_, for example _Tools > Board > Arduino AVR Boards > Arduino Uno_. + +04. Select the port the board is connecting to in _Tools > Port_. + +05. Open _File > Examples > 11.ArduinoISP > ArduinoISP_. + + ![IDE with ArduinoISP example selected in the menu](img/ide1-windows-example-ArduinoISP.png) + +06. Click ![Upload button](img/symbol_upload.png) **Upload** to upload the sketch to the board. + +07. Select the **target board** in _Tools > Board_. + +08. Select _Tools > Programmer > Arduino as ISP_. + +09. We can now start the burning process. It's a good idea to enable [verbose upload output](https://support.arduino.cc/hc/en-us/articles/4407705216274) in preferences since there will be no console output during the process otherwise. To start the process, select _Tools > Burn Bootloader_. + + ![IDE with Burn Bootloader selected in the menu](img/ide1-windows-burn-bootloader.png) + +10. Wait for the process to complete, which may take up to a minute. When it's finished, the message "Done burning bootloader" will appear on top of the console, or in a bottom-right notification pop-up, depending on your IDE version. + + ![IDE with "Done burning bootloader" message](img/ide1-windows-burn-bootloader-done.png) + +--- + +## Troubleshooting + +### Error: Missing programmer + +``` +avrdude: Yikes! Invalid device signature. + Double check connections and try again, or use -F to override + this check. + +Error while burning the bootloader: Failed chip erase: uploading error: exit status 1 +``` + +Check your selection in _Tools > Programmer_. + +### Error: Failed chip erase: uploading error: exit status 1 + +``` +Error while burning the bootloader: Failed chip erase: uploading error: exit status 1 +``` + +* Make sure you've selected the target board in _Tools > Board_. +* Make sure you've connected the RESET pin correctly. + +### avrdude: Error: Could not find USBtiny device + +``` +Error while burning bootloader. +avrdude: Error: Could not find USBtiny device (0x2341/0x49) + +``` + +Make sure you've selected **Arduino as ISP** in _Tools > Programmer_, and **not** ArduinoISP or other similar options. + +--- + +## Further reading + +* [Bootloader (Arduino Docs)](https://docs.arduino.cc/hacking/software/Bootloader) +* [Arduino as ISP and Arduino Bootloaders](https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP). Some information is not up to date (no capacitor is needed for the Mega 2560 Rev3). diff --git a/content/Hardware/Core Boards/How-to-burn-bootloader-to-Arduino-Uno-using-Arduino-Mega.md b/content/Hardware/Core Boards/How-to-burn-bootloader-to-Arduino-Uno-using-Arduino-Mega.md deleted file mode 100644 index 4a3c0556..00000000 --- a/content/Hardware/Core Boards/How-to-burn-bootloader-to-Arduino-Uno-using-Arduino-Mega.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: "How to burn bootloader to Arduino Uno using Arduino Mega" ---- - -The bootloader is a piece of code stored in a reserved space in your Arduino board's memory. It initiates the sketch when the board is powered and allows new sketches to be uploaded from your PC. This tutorial explains how to burn the bootloader to an Arduino Uno using an Arduino Mega. - ---- - -## What you'll need - -* Arduino Mega -* Arduino Uno -* 10uF capacitor (For older version of Mega) -* USB 2.0 cable x 1 -* Jumper cables x 6nos - -## Instructions - -01. Connect Arduino Mega to your PC. Open Arduino IDE. - -02. Select _Tools > Board > Arduino AVR Boards > Arduino Mega or Mega 2560_. - -03. Open the `ArduinoISP` sketch from the menu bar: _File > Examples > 11.Arduino ISP > ArduinoISP_ - -04. ![Upload button](img/symbol_upload.png) **Upload** the sketch. - -05. Disconnect Arduino Mega from your PC. - -06. Connect the boards as follows: - - ![Mega_to_Uno_burn_bootloader](img/Mega_to_Uno_burn_bootloader.jpg) - - | PROGRAMMER PINS | TARGET PINS | - |:---------------:|:-----------:| - | PIN 10 | RESET | - | PIN 51 | PIN 11 | - | PIN 50 | PIN 12 | - | PIN 52 | PIN 13 | - | 5V | 5V | - | GND | GND | - - > Note: For the latest models of Arduino Mega the additional 10uF capacitor between the Reset and GND is not required. - -07. Connect Arduino Mega to your PC again. - -08. Select _Tools > Board > Arduino AVR Boards > Arduino Uno_. - -09. Select _Arduino as ISP_ in _Tools > Programmer_. - -10. Select _Tools > Burn Bootloader_. - -11. Wait for the process to finish. When it's complete, `avrdude done. Thank you.` will be printed to console. diff --git a/content/Hardware/Core Boards/How-to-burn-the-bootloader-between-two-Arduino-Mega.md b/content/Hardware/Core Boards/How-to-burn-the-bootloader-between-two-Arduino-Mega.md deleted file mode 100644 index 0b0bb9b4..00000000 --- a/content/Hardware/Core Boards/How-to-burn-the-bootloader-between-two-Arduino-Mega.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: "How to burn the bootloader between two Arduino Mega" ---- - -This is a tutorial that explains how to burn the bootloader using 2 Arduino Mega. 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. - -## Components required - -* Arduino Mega 2560 - 2 -* Jumper wires - 6 -* USB 2.0 cable - 1 - -## Steps to follow - -1. Choose the working board as your programmer. - -2. Make the connections according to the below table - - | Controller (Pin number) | Peripheral (Pin number) | - |:-----------------------: |:-----------------------: | - | 50 - CIPO | 50 - CIPO | - | 51 - COPI | 51- COPI | - | 52 - SCK | 52 - SCK | - | **53 - SS** | **RESET PIN** | - - ![Mega-To-Mega connections](img/Mega-to-mega_connection.png) - -3. Open Arduino IDE. - -4. Click on *File > Examples > Arduino ISP*. - -5. In the *ArduinoISP* example, make the following changes according to the pin connection. - - [Code snippet](https://create.arduino.cc/example/builtin/11.ArduinoISP%5CArduinoISP/ArduinoISP/preview?embed&snippet=L68-L89&hidenumbers#L73,L85-L87) - -6. Make sure the board selected is mega 2560 and the correct port is selected, then upload the code. - -7. After uploading the code. Go to `Tools > Programmer > 'Arduino as ISP'`. - -8. Go to `Tools > Burn Bootloader`. It will take few minutes to be done. diff --git a/content/Hardware/Core Boards/How-to-burn-the-bootloader-between-two-Arduino-UNO.md b/content/Hardware/Core Boards/How-to-burn-the-bootloader-between-two-Arduino-UNO.md deleted file mode 100644 index cd4133f1..00000000 --- a/content/Hardware/Core Boards/How-to-burn-the-bootloader-between-two-Arduino-UNO.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: "How to burn the bootloader between two Arduino UNO" ---- - -The bootloader is a piece of code that is stored in a reserved space of the memory of your Arduino board. Basically, this code initiates the sketch as soon as the board is powered on and also allows new sketches to be uploaded from the PC. - -It can happen that this piece of code gets corrupted when attempting to upload a bad sketch, applying too high/low voltage to I/O pins or power inputs. If this is the case, the board will not be detected by your PC any more and the port will show grayed out on Arduino IDE. - -If by chance you happen to have an additional Arduino UNO and 6 jumper wires you can easily reprogram your board using the extra UNO board as a programmer. Just need to upload ‘Arduino ISP’ sketch, connect the boards and click ‘Burn Bootloader’. - -## Material needed - -* Programmer board (Arduino UNO) -* 6 jumper wires: If you choose to connect ICSP pins you need female jumpers on both ends (except for pin 10 - reset connection for which one end is male). Otherwise, I/O pin connection requires 6 male jumper wires. -* PC with Arduino IDE installed -* Target board (Arduino UNO) - -## Steps - -1. Open the Arduino IDE. - -2. Connect the programmer board to your PC. - - > Note: Make sure to select Arduino Uno as the Board and to select its corresponding Port. - -3. Upload the `ArduinoISP` sketch to the Arduino UNO programmer board. - - Find the sketch in Arduino IDE top menu: *File > Examples > 11.Arduino ISP > ArduinoISP*. - -4. After uploading the code. Go to `Tools > Programmer > 'Arduino as ISP'`. - -5. Disconnect the programmer board from your PC. - -6. Connect the two boards as follows: - - ![Target-Programmer interconnection using I/O PINS](img/ICSP.png) - - | PROGRAMMER PINS | TARGET PINS | - |:---------------:|:-----------:| - | PIN 10 | RESET | - | PIN 11 | PIN 11 | - | PIN 12 | PIN 12 | - | PIN 13 | PIN 13 | - | 5V | 5V | - | GND | GND | - -7. Connect the programmer board to your PC again. - -8. Click on: `Tools > Burn Bootloader` - - The following confirmation message will show at the bottom of Arduino IDE if successful: - - ![Success message](img/SuccessBootloader.png) - -Note that you can also connect the boards using the ICSP pins on each board, as these are interconnected to respective I/O pins. 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 1 shows (placing the UNO board so the ICSP label above the connector is straight as you would normally read it). - -![ICSP connection](img/ICSP.png) - -| PROGRAMMER PINS | TARGET ICSP | -|:---------------:|:-----------:| -| PIN 10 | ICSP 5 | -| ICSP 4 | ICSP 4 | -| ICSP 1 | ICSP 1 | -| ICSP 3 | ICSP 3 | -| ICSP 2 | ICSP 2 | -| ICSP 6 | ICSP 6 | diff --git a/content/Hardware/Core Boards/How-to-burn-the-bootloader-on-an-Arduino-Mega-using-an-Arduino-UNO.md b/content/Hardware/Core Boards/How-to-burn-the-bootloader-on-an-Arduino-Mega-using-an-Arduino-UNO.md deleted file mode 100644 index b06e0a39..00000000 --- a/content/Hardware/Core Boards/How-to-burn-the-bootloader-on-an-Arduino-Mega-using-an-Arduino-UNO.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: "How to burn the bootloader on an Arduino Mega using an Arduino UNO" ---- - -The bootloader is a piece of code stored in a reserved space in your Arduino board's memory. It initiates the sketch when the board is powered and allows new sketches to be uploaded from your PC. This tutorial explains how to burn the bootloader to an Arduino Mega using an Arduino Uno. - -## Requirements - -* 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 - -01. Connect the Arduino Uno to your computer. - -02. In Arduino IDE, select _Tools > Board > Arduino AVR Boards > Arduino Uno_. - -03. Select the port your board is connected to in _Tools > Port_. - -04. Open the `ArduinoISP` sketch: _File > Examples > 11.ArduinoISP > ArduinoISP_. - -05. Click ![Upload button](img/symbol_upload.png) **Upload** to upload the sketch to the board. - -06. Disconnect the Uno from the PC. - -07. Connect the two boards as follows using the ICSP pins on each board: - - ![Target-Programmer interconnection using I/O PINS](img/Connections-mega2Uno.png) - - | PROGRAMMER ICSP PINS | TARGET ICSP PINS | - |:---------------------:|:---------------:| - | PIN 10 | RESET | - | ICSP-4 | ICSP-4 | - | ICSP-1 | ICSP-1 | - | ICSP-3 | ICSP-3 | - | ICSP-2 | ICSP-2 | - | ICSP-6 | ICSP-6 | - -08. Connect the Arduino Uno to your PC again. - -09. Check the board and port selection like in step 2 and 3. - -10. Select _Tools > Programmer > Arduino as ISP_. - -11. Select _Tools > Burn Bootloader_. - - The following confirmation message will show at the bottom of Arduino IDE if successful: - - ![Success message: "avrdude done. Thank you."](img/SuccessBootloader.png) - -> **Note:** 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. - -| PROGRAMMER PINS | TARGET PINS | -|:---------------:|:-----------:| -| PIN 10 | RESET | -| PIN 11 | PIN 51 | -| PIN 12 | PIN 50 | -| PIN 13 | PIN 52 | -| 5V | 5V | -| GND | GND | diff --git a/content/Hardware/Core Boards/How-to-burn-the-bootloader-on-an-Arduino-Uno-using-an-Arduino-Nano.md b/content/Hardware/Core Boards/How-to-burn-the-bootloader-on-an-Arduino-Uno-using-an-Arduino-Nano.md deleted file mode 100644 index 9bf7e9f8..00000000 --- a/content/Hardware/Core Boards/How-to-burn-the-bootloader-on-an-Arduino-Uno-using-an-Arduino-Nano.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: "How to burn the bootloader on an Arduino Uno using an Arduino Nano" ---- - -The bootloader is a piece of code stored in a reserved space in your Arduino board's memory. It initiates the sketch when the board is powered and allows new sketches to be uploaded from your PC. This tutorial explains how to burn the bootloader to an Arduino Uno using an Arduino Nano. - ---- - -## What you'll need - -* Arduino Nano -* Arduino Uno -* USB Cable Type A Male to Micro Type B Male -* Jumper cables x 6nos - -## Instructions - -01. Open Arduino IDE. - -02. Connect Arduino Nano to your PC. - -03. Select Arduino Nano in _Tools > Board > Arduino AVR Boards_. - -04. Open the `ArduinoISP` sketch from the menu bar: _File > Examples > 11.ArduinoISP > ArduinoISP_ - -05. ![Upload button](img/symbol_upload.png) **Upload** the sketch. - -06. Disconnect Arduino Nano board from your PC. - -07. Connect the boards as follows: - - ![Nano to Uno Burn bootloader](img/Nano_to_Uno_burn_bootloader.png) - - | Programmer Pin | Target Pin | - |----------------|------------| - | D10 SS | Reset | - | 5V | 5V | - | GND | GND | - | D11 COPI | D11 COPI | - | D12 CIPO | D12 CIPO | - D13 SCK | D13 SCK | - -08. Connect Arduino Nano to your PC again. - -09. Select _Arduino as ISP_ in _Tools > Programmer_. - -10. Select _Tools > Burn Bootloader_. - -11. Wait for the process to finish. When it's complete, `avrdude done. Thank you.` will be printed to console. diff --git a/content/Hardware/Core Boards/img/Connections-mega2Uno.png b/content/Hardware/Core Boards/img/Connections-mega2Uno.png index 9c4ea7a5..2e528ebd 100644 Binary files a/content/Hardware/Core Boards/img/Connections-mega2Uno.png and b/content/Hardware/Core Boards/img/Connections-mega2Uno.png differ diff --git a/content/Hardware/Core Boards/img/ICSP.png b/content/Hardware/Core Boards/img/ICSP.png deleted file mode 100644 index 4132c873..00000000 Binary files a/content/Hardware/Core Boards/img/ICSP.png and /dev/null differ diff --git a/content/Hardware/Core Boards/img/Mega-to-mega_connection.png b/content/Hardware/Core Boards/img/Mega-to-mega_connection.png deleted file mode 100644 index 3f74058d..00000000 Binary files a/content/Hardware/Core Boards/img/Mega-to-mega_connection.png and /dev/null differ diff --git a/content/Hardware/Core Boards/img/Mega_to_Uno_burn_bootloader.jpg b/content/Hardware/Core Boards/img/Mega_to_Uno_burn_bootloader.jpg deleted file mode 100644 index 0e02c8d0..00000000 Binary files a/content/Hardware/Core Boards/img/Mega_to_Uno_burn_bootloader.jpg and /dev/null differ diff --git a/content/Hardware/Core Boards/img/Nano_to_Uno_burn_bootloader.png b/content/Hardware/Core Boards/img/Nano_to_Uno_burn_bootloader.png index dff1953f..03a34aa4 100644 Binary files a/content/Hardware/Core Boards/img/Nano_to_Uno_burn_bootloader.png and b/content/Hardware/Core Boards/img/Nano_to_Uno_burn_bootloader.png differ diff --git a/content/Hardware/Core Boards/img/SuccessBootloader.png b/content/Hardware/Core Boards/img/SuccessBootloader.png deleted file mode 100644 index 73d7f50d..00000000 Binary files a/content/Hardware/Core Boards/img/SuccessBootloader.png and /dev/null differ diff --git a/content/Hardware/Core Boards/img/icsp-headers.png b/content/Hardware/Core Boards/img/icsp-headers.png new file mode 100644 index 00000000..8ea32667 Binary files /dev/null and b/content/Hardware/Core Boards/img/icsp-headers.png differ diff --git a/content/Hardware/Core Boards/img/ide1-windows-burn-bootloader-done.png b/content/Hardware/Core Boards/img/ide1-windows-burn-bootloader-done.png new file mode 100644 index 00000000..0949c65b Binary files /dev/null and b/content/Hardware/Core Boards/img/ide1-windows-burn-bootloader-done.png differ diff --git a/content/Hardware/Core Boards/img/ide1-windows-burn-bootloader.png b/content/Hardware/Core Boards/img/ide1-windows-burn-bootloader.png new file mode 100644 index 00000000..725465bd Binary files /dev/null and b/content/Hardware/Core Boards/img/ide1-windows-burn-bootloader.png differ diff --git a/content/Hardware/Core Boards/img/ide1-windows-example-ArduinoISP.png b/content/Hardware/Core Boards/img/ide1-windows-example-ArduinoISP.png new file mode 100644 index 00000000..8f342aed Binary files /dev/null and b/content/Hardware/Core Boards/img/ide1-windows-example-ArduinoISP.png differ diff --git a/content/Hardware/Nano Family/How-to-burn-the-bootloader-in-an-Arduino-Nano-using-an-Arduino-UNO.md b/content/Hardware/Nano Family/How-to-burn-the-bootloader-in-an-Arduino-Nano-using-an-Arduino-UNO.md deleted file mode 100644 index 1ee54167..00000000 --- a/content/Hardware/Nano Family/How-to-burn-the-bootloader-in-an-Arduino-Nano-using-an-Arduino-UNO.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: "How to burn the bootloader in an Arduino Nano using an Arduino UNO" ---- - -The bootloader is a piece of code that is stored in a reserved space of the memory of your Arduino board. Basically, this code initiates the sketch as soon as the board is powered on and also allows new sketches to be uploaded from the PC. - -It can happen that this piece of code gets corrupted when attempting to upload a bad sketch, applying too high/low voltage to I/O pins or power inputs. If this is the case, the board will not be detected by your PC any more and the port will show grayed out on Arduino IDE. - -If by chance you happen to have an Arduino UNO and 6 jumper wires you can easily reprogram your Arduino Nano using your UNO board as a programmer. Just need to upload ‘Arduino ISP’ sketch, connect the boards and click ‘Burn Bootloader’. - -All you need to perform this operation is: a programmer board (Arduino UNO), 6 jumper wires (please note jumpers need to be ‘male’ on one end and ‘female’ on the other end), PC with Arduino IDE installed, and your Arduino Nano. - -Detailed instructions below: - -1. Upload the `ArduinoISP` sketch to the Arduino UNO: - - Find the sketch in Arduino IDE top menu: `File > Examples > 11.Arduino ISP > ‘ArduinoISP’`. Then disconnect the Arduino UNO board from the PC. - -2. Connect the boards as follows: - - ![Connection](img/uno-to-nano_connection.png) - - > Note that the connections are made between Arduino UNO I/O pins and Arduino Nano ICSP connector. This connector has 6 pins that are arranged as the diagram shows (placing the Nano board with ICSP connector facing up leaving the USB port on the right side). - - ![ICSP connection](img/ICSP_names.png) - - |PROGRAMMER (I/O PINS) | TARGET (ICSP) | - |:-------------------:|:-----------------:| - | PIN 10 | ICSP 5 | - | PIN 11 | ICSP 4 | - | PIN 12 | ICSP 1 | - | PIN 13 | ICSP 3 | - | 5V | ICSP 2 | - | GND | ICSP 6 | - -3. Connect Arduino UNO back to your PC via USB. - -4. When choosing the port and board, this time you need to select `Tools > Programmer > Arduino as ISP`. - -5. Click on: `Tools > Burn Bootloader`