Installing an Arduino Bootloader

Pages
Contributors: M-Short
Favorited Favorite 25

Hardware Hookup

In-Circuit Serial Programming (ICSP)

It's very uncommon to program ICs before they are soldered onto a PCB. Instead, most microcontrollers have what's called an in-system programming (ISP) header. Particularly, some IC manufacturers, such as Atmel and Microchip, have a specialized ISP method for programming their ICs. This is referred to as in-circuit serial programming (ICSP). Most Arduino and Arduino compatible boards will have a 2x3 pin ICSP header on them. Some may even have more than one depending on how many ICs live on the PCB. It breaks out three of the SPI pins (MISO, MOSI, SCK), power, ground, and reset. These are the pins you'll need to connect your programmer to in order to reflash the firmware on your board.

UNO ISP

Here we have the Arduino Uno R3. It has two ICSP headers: one for the ATmega16U2 and one for the ATmega328. To reflash the bootloader on this board, you would use just the ICSP header for the ATmega328.

On some smaller boards you may not see this connector, but the pins should be broken out elsewhere. Whether you're using an SMD IC or a DIP IC, the ISP pins should be accessible in one form or another. Some boards might only have test points for the ISP header. If this is the case, you may want to consider getting an ISP Pogo Adapter. This kit allows you to temporarily make a good connection with test test points in order to reprogram your IC.

SparkFun ISP Pogo Adapter

SparkFun ISP Pogo Adapter

KIT-11591
$13.95
4

Once you have located the six ICSP pins on your board, it's time to hook up your programmer to the board. You can use a programming cable to connect the two, or, if you don't have a cable, you can just use some male-to-female jumper wires.

Jumper Wires Premium 6" M/F Pack of 10

Jumper Wires Premium 6" M/F Pack of 10

PRT-09140
$4.50
1
AVR Programming Cable

AVR Programming Cable

CAB-09215
$2.10
3

Connecting the Pocket AVR Programmer to Target

If you are using a programmer such as the pocket AVR programmer, your setup should look something like the connection below with the AVR programming cable's arrow (◄) connected to MISO. If you look really closely at the molding of the 2x3 connector, you should be able to notice the arrow (◄) pointing to pin 1 relative to the position of a standard ICSP header.

Top View of the Pocket AVR Programmer Connected to a Target AVR Arduino Uno with Pinouts

Click for larger image.

Connecting the Arduino as ISP to Target

Or, if you're using the Arduino as your programmer, it should look the image below. Make sure to power the Arduino as ISP by connecting it to your computer.

Fritzing Diagram of Arduino as ISP Connected to Target Arduino

Click for larger image.

Hookup Table

Here's a table to help clarify which connections go where. Depending on the Arduino, you may have access to the ICSP pins only on the 2x3 ICSP header. Make sure to refer to the board layout for more information on the Arduino's SPI connections.

AVR Programmer Arduino as ISP 2x3 ICSP Header ATmega328 ATmega2560 ATmega32U4
5V Vcc/5V Pin 2 Vcc Vcc Vcc
GND GND Pin 6 GND GND GND
MOSI MOSI/D11 Pin 4 D11 D51 D16
MISO MISO/D12 Pin 1 D12 D50 D14
SCK SCK/D13 Pin 3 D13 D52 D15
Reset D10 Pin 5 Reset Reset Reset