Installing an Arduino Bootloader

Contributors: M-Short

Pages

Connecting the Programmer

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), and 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.

alt text

ISP Pogo Adapter Kit Fully Assembled. You can connect any of the programmers we mentioned in the previous section to this board.

If you are having trouble finding the ICSP pins on your particular Arduino board, you can consult this website for detailed pinouts of most Arduino related ICs and then some.

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.

If you are using a programmer such as the MKII or the Pocket Programmer, your setup should look something like this:

alt text

Click for larger image.

Or, if you’re using the Arduino as your programmer, it should look like this:

alt text

Click for larger image.

Here’s a table to help clarify which connections go where.

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

Want more information about SparkFun's classes? Interested in getting involved with teaching electronics? Just want to talk? Sign up for our newsletter, or contact our education department.

SparkFun is a company built around one core idea – sharing ingenuity. We think everyone should have the hardware and resources to learn and play with cool electronic gadgetry.

Share, give, learn, SparkFun.

Do you regularly instruct classes and workshops in a formal or informal learning environment? SparkFun offers Educator Discounts to people teaching and sharing electronics.

Find out more.