In-System Programming

ISP is the simplest programming method to set up, and in 99% of all cases, it's all you need.

Connecting your Standard Arduino

ISP requires 6 signals (including power and ground), as shown in this illustration. Do NOT use the ICSP headers, as the one at the right has the RESET pin connected to your own Arduino's RESET signal, and the one at the top left is connected to the signals for the Atmega16U2 USB slave processor.

The XTAL signal can optionally be connected to your target's XTAL1 pin, as discussed below.

Connecting your Arduino Micro/Leonardo

The pin connections for an Arduino Micro are shown in this illustration, and for the Leonardo, the same pins would be used. Note that:

Connecting your Target Microcontroller

The ISP signals need to be connected to the corresponding signals on your target microcontroller / board. Details for each target are discussed in the Connection Diagrams chapter.

Since is pin compatible with the ArduinoISP sketch, the circuits shown at http://arduino.cc/en/Tutorial/ArduinoISP for Arduino boards all should work with as well. You can disregard the circuit showing an external crystal — it should work as well, but is not needed, as generates its own clock signal.

Supplying an External Clock Signal

While all AVR MCUs are capable of running from internally generated clock signals, in many designs, they are instead set up to rely on an external clock signal — either for better timing accuracy, or because a particular operating frequency is desirable. If you try to program a MCU on a breadboard and its fuses have been (deliberately or accidentally) set to require an external clock signal, ISP will not work on that MCU without supplying a clock signal.

For this purpose, uses Arduino timer 1 to generate a clock signal XTAL. If you get an upload error, try connecting this signal to the XTAL1 pin of your MCU. Curiously, and somewhat inexplicably to me, I have found that when Low Frequency Crystal Oscillator mode (CKSEL[3:0] = 6) is selected, connecting the clock signal to XTAL1 did not work, but connecting to XTAL2 did work, so you may want to try this as well.

Limp Mode: Software SPI

will normally operate its SPI connection at a 125kHz clock rate. With some clock settings (e.g. Internal 128kHz Oscillator) of the target microcontroller, or external clock signals wired to the board, this rate is too fast for the target microcontroller to keep up. For this case, will fall back to a software simulation of SPI, using the same pins, but operating deliberately at slower speeds (Down to less than 1kHz, if necessary)

With the combination of Limp Mode and the external clock signal, in ISP mode should be able to handle pretty much any setting of the clock fuses. Still, there are other fuses, e.g. RSTDISBL or SPIEN, that will prevent ISP mode from working when changed, so you will need to use High Voltage Programming to deal with those cases.