Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.

Arduino ISP: Use Arduino as Programmer

What is Arduino ISP and Why It Matters

Arduino ISP (In-System Programmer) is firmware that transforms any Arduino board into an AVR programmer, allowing you to program microcontrollers without removing them from circuits. This functionality uses the SPI (Serial Peripheral Interface) protocol to communicate with the target chip’s ICSP (In-Circuit Serial Programming) pins.

In production environments, this capability is invaluable. Instead of purchasing dedicated programmers like USBtinyISP or AVR Dragon, you leverage Arduino hardware you already own. More importantly, it enables field programming and bootloader recovery—critical when troubleshooting deployed systems.

Why Use Arduino ISP Instead of the Bootloader

Most Arduino boards ship with a bootloader that enables USB programming. However, several scenarios require Arduino ISP:

Bootloader Corruption: Upload failures or power interruptions can corrupt the bootloader, making USB programming impossible. Arduino ISP restores functionality.

New Microcontrollers: Blank ATmega chips don’t have bootloaders. Arduino ISP burns the initial bootloader.

Production Programming: Custom PCBs with AVR chips need initial programming. Arduino ISP provides a cost-effective solution.

Memory Optimization: The bootloader consumes 512-2KB of flash memory. Programming via ISP uses the entire memory space.

Fuse Configuration: Arduino ISP allows programming fuse bits to configure oscillator settings, brown-out detection, and other hardware features.

Hardware Requirements and Setup

Components Needed

ComponentPurposeNotes
Programmer ArduinoActs as ISP programmerUno, Nano, Mega all work
Target Arduino/AVRDevice to programAny AVR-based board
Jumper WiresConnect programmer to target6 minimum (M-M or M-F)
10µF CapacitorPrevents programmer resetOptional but recommended
LEDs (optional)Status indicators2 LEDs + resistors

Understanding ICSP Pin Configuration

The ICSP header is a 2×3 pin arrangement standard on Arduino boards. Understanding the pinout is critical:

ICSP Header Pinout (Standard)

┌─────────┐

│ 1  2    │ Pin 1: MISO (Master In Slave Out)

│ 3  4    │ Pin 2: VCC (5V or 3.3V)

│ 5  6    │ Pin 3: SCK (Serial Clock)

└─────────┘ Pin 4: MOSI (Master Out Slave In)

            Pin 5: RESET

            Pin 6: GND (Ground)

Pin 1 is typically marked with a dot or square pad on the PCB.

Arduino Pin Mapping

ICSP PinFunctionArduino UnoArduino MegaArduino Nano
MISOData from targetD12D50D12
MOSIData to targetD11D51D11
SCKClock signalD13D52D13
RESETTarget resetD10D10D10
VCCPower (optional)5V5V5V
GNDGroundGNDGNDGND

Step-by-Step Wiring Guide

Basic Wiring Configuration

Connect the programmer Arduino to the target device following this schematic:

Programmer Arduino → Target Arduino/AVR

D10 (SS) → RESET

D11 (MOSI) → MOSI (D11 or ICSP-4)

D12 (MISO) → MISO (D12 or ICSP-1)

D13 (SCK) → SCK (D13 or ICSP-3)

5V → VCC (ICSP-2) [optional if target powered separately]

GND → GND (ICSP-6)

Critical Wiring Considerations

Power Management: The target board must be powered during programming. You can either:

  • Power target via its USB connection
  • Power target from programmer’s 5V pin
  • Use external power supply

Never power from multiple sources simultaneously to avoid voltage conflicts.

Reset Capacitor: Place a 10µF electrolytic capacitor between RESET and GND on the programmer Arduino (positive lead to RESET). This prevents the programmer from resetting during the programming process. Without this, many programming attempts will fail with sync errors.

Optional Status LED Configuration

For visual feedback during programming:

LED 1 (Heartbeat) → D9 + 1kΩ resistor + GND

LED 2 (Error) → D8 + 1kΩ resistor + GND

LED 3 (Programming) → D7 + 1kΩ resistor + GND

The ArduinoISP sketch uses these pins for status indication:

  • Heartbeat: Pulses to show programmer is alive
  • Error: Lights on error conditions
  • Programming: Illuminates during data transfer

Software Configuration and Programming

Loading ArduinoISP Firmware

Step 1: Connect programmer Arduino to your computer via USB

Step 2: Open Arduino IDE → File → Examples → 11.ArduinoISP → ArduinoISP

Step 3: Select your programmer board (Tools → Board → your Arduino model)

Step 4: Select COM port (Tools → Port → your port)

Step 5: Upload sketch (Ctrl+U or Upload button)

The green LED should pulse when upload completes, indicating the programmer is ready.

Burning Bootloader to Target

Step 1: Wire programmer to target as described above

Step 2: In Arduino IDE, select target board type (Tools → Board → target board)

Step 3: Select programmer (Tools → Programmer → “Arduino as ISP”)

Critical: Select “Arduino as ISP” NOT “ArduinoISP.org”

Step 4: Burn bootloader (Tools → Burn Bootloader)

The process takes 10-30 seconds. Success message appears when complete.

Programming Sketches Without Bootloader

To upload code directly via ISP (bypassing bootloader):

Step 1: Open your sketch

Step 2: Select target board (Tools → Board)

Step 3: Select “Arduino as ISP” programmer (Tools → Programmer)

Step 4: Upload using programmer (Sketch → Upload Using Programmer or Ctrl+Shift+U)

Important: This overwrites the bootloader. To restore USB programming capability, burn bootloader again.

Common Use Cases in Production

Recovering Bricked Arduinos

When an Arduino won’t accept sketches via USB, the bootloader is likely corrupted. Symptoms include:

  • Upload errors every time
  • IDE can’t communicate with board
  • Board appears “dead” despite power

Arduino ISP restores functionality in 90% of these cases. Simply burn the bootloader following the steps above.

Programming Bare ATmega Chips

For custom PCB designs using ATmega328P or similar:

Step 1: Create ICSP header on your PCB (2×3 pin header)

Step 2: Connect Arduino ISP to ICSP header

Step 3: Burn bootloader (for Arduino compatibility)

Step 4: Upload your production sketch

Step 5: Optionally disable bootloader to reclaim memory

Cloning Arduino Projects

To duplicate a working Arduino project:

Step 1: Read fuse settings from working board (requires avrdude commands)

Step 2: Burn bootloader to new board

Step 3: Upload sketch via ISP

Step 4: Configure fuses if needed

Setting Fuse Bits

Fuse bits control critical microcontroller behavior:

  • Clock source selection (internal/external)
  • Clock speed settings
  • Brown-out detection voltage
  • Programming lock bits
  • Bootloader size reservation

Warning: Incorrect fuse settings can brick your chip. Common mistakes include setting external oscillator fuses when no crystal is present.

Use a fuse calculator like Engbedded AVR Fuse Calculator before modifying fuses.

Troubleshooting Common Issues

Problem: “avrdude: stk500_getsync(): not in sync”

Causes and Solutions:

  1. Missing reset capacitor: Add 10µF cap between programmer’s RESET and GND
  2. Wrong programmer selected: Use “Arduino as ISP” not “ArduinoISP.org”
  3. Poor connections: Check all 6 wires, ensure firm contact
  4. Target not powered: Verify target has power (LED should illuminate)
  5. Wrong board selected: Ensure target board type is correctly selected

Problem: Programmer Resets During Programming

Solution: The 10µF capacitor is essential. Connect positive lead to programmer’s RESET, negative to GND. This holds the programmer in running state during ISP operations.

Problem: “avrdude: Yikes! Invalid device signature”

Causes and Solutions:

  1. Wrong target board selected: Verify board type matches actual chip
  2. Wiring error: Check MISO/MOSI not swapped
  3. Chip damaged: Test with known-good chip
  4. Voltage mismatch: Verify 5V chip not running at 3.3V or vice versa

Problem: Fuses Set Incorrectly, Chip Won’t Respond

If you’ve set fuses for external oscillator without connecting a crystal, the chip appears “bricked.” Recovery options:

Method 1: Connect appropriate crystal/resonator temporarily

Method 2: Use high-voltage programming (requires specialized hardware)

Method 3: Provide external clock signal to XTAL1 pin

Prevention is key—always verify fuse calculations before programming.

Problem: “Verification Failed” After Upload

Causes:

  • Intermittent connections
  • Power supply instability
  • Electromagnetic interference

Solutions:

  • Shorten jumper wires (under 6 inches ideal)
  • Add 0.1µF capacitor across target’s VCC/GND
  • Keep programmer away from power supplies/motors
  • Reduce upload speed (modify ArduinoISP sketch)

Advanced Techniques

Programming Multiple Targets

For production runs, create a programming jig:

Components:

  • Arduino ISP (permanently programmed)
  • Pogo pin fixture matching ICSP footprint
  • Status LEDs
  • Go/No-Go indicators

This setup programs chips in seconds without individual wire connections.

Automated Testing Integration

Combine Arduino ISP with test scripts:

#!/bin/bash

# Auto-program and test script

# Burn bootloader

avrdude -c stk500v1 -P /dev/ttyUSB0 -b 19200 -p m328p -e -U flash:w:bootloader.hex

# Upload test firmware

avrdude -c stk500v1 -P /dev/ttyUSB0 -b 19200 -p m328p -U flash:w:test.hex

# Run verification

python verify_output.py

Programming 3.3V Devices

When programming 3.3V Arduino variants (Due, Zero, etc.):

Option 1: Use level shifters between 5V programmer and 3.3V target

Option 2: Use 3.3V Arduino as programmer (must match target voltage)

Never connect 5V directly to 3.3V device—permanent damage results.

Resource Library for Arduino ISP Development

Official Documentation

Essential Software Tools

  • Arduino IDE: Free download from arduino.cc
  • AVRdude: Command-line AVR programmer (bundled with Arduino IDE)
  • Engbedded Fuse Calculator: engbedded.com/fusecalc
  • USBtinyISP Drivers: For Windows systems

Hardware Resources

  • ICSP Cable Assembly Guide: Build custom programming cables
  • Pogo Pin Adapters: Spring-loaded programming contacts
  • ZIF Socket Boards: Zero-insertion-force sockets for DIP chips

Community Resources

  • Arduino Forum ISP Section: Community troubleshooting
  • AVRFreaks Forum: Detailed AVR programming discussions
  • GitHub ArduinoISP: Updated firmware versions

Recommended Reading

  • AVR Microcontroller and Embedded Systems: Detailed AVR architecture
  • ATmega328P Datasheet: Complete chip specifications
  • Arduino Cookbook: Practical Arduino projects and techniques

Frequently Asked Questions

Q1: Can I use Arduino ISP with non-Arduino AVR boards?

Absolutely. Arduino ISP works with any AVR microcontroller that supports ISP programming—this includes ATtiny series, ATmega series, and many others. The key requirement is access to the ICSP pins (MISO, MOSI, SCK, RESET, VCC, GND). You can program standalone ATmega328P chips, ATtiny85 for small projects, or custom PCBs with any AVR chip. Just ensure the target board type is correctly configured in Arduino IDE or use avrdude directly with appropriate device parameters. Many hobbyists use Arduino ISP to program ATtiny chips for compact projects that don’t need full Arduino capability.

Q2: Why do I need a capacitor between RESET and GND on the programmer?

The capacitor prevents auto-reset during programming. When the Arduino IDE initiates serial communication, it toggles the DTR line, which normally resets the Arduino to enter bootloader mode. During ISP operations, you don’t want the programmer to reset—it needs to stay running to maintain SPI communication with the target. The 10µF capacitor holds the RESET line high during these DTR pulses, keeping the programmer operational. Without it, you’ll encounter “not in sync” errors as the programmer resets mid-operation. The capacitor value isn’t critical; anything from 4.7µF to 22µF works. Ensure proper polarity—positive lead to RESET.

Q3: What’s the difference between “Arduino as ISP” and “ArduinoISP.org” in the programmer menu?

“Arduino as ISP” uses the standard ArduinoISP sketch with 19200 baud communication, which works reliably with most Arduino boards. “ArduinoISP.org” uses different communication parameters intended for boards programmed with alternative firmware. Always select “Arduino as ISP” unless you specifically modified your programmer’s firmware. Using the wrong selection is the single most common cause of programming failures—I’ve spent hours troubleshooting projects only to discover this simple setting was incorrect. The Arduino IDE doesn’t prevent selecting the wrong option, so this catches many beginners.

Q4: Can I use Arduino ISP to recover a completely dead Arduino that shows no signs of life?

If there’s truly no power (no power LED), Arduino ISP won’t help—that’s a hardware problem (power supply, voltage regulator, etc.). However, if the power LED illuminates but the Arduino won’t accept sketches or respond to USB, Arduino ISP can usually recover it. The bootloader might be corrupted, but the microcontroller itself is fine. Wire up your Arduino ISP, burn the bootloader, and the board should revive. The exception is if fuse bits were incorrectly set—for example, configured for an external crystal that doesn’t exist. This requires either connecting an appropriate crystal temporarily or high-voltage programming. I’ve recovered dozens of “dead” Arduinos this way. One word of caution: if someone uploaded a sketch that drives all pins high simultaneously, the chip might be physically damaged from overcurrent.

Q5: Is it possible to program Arduino bootloaders to ATmega chips removed from the board?

Yes, this is a common production technique. You’ll need a way to connect the chip to your Arduino ISP—either a breadboard with appropriate wiring or a dedicated ZIF (Zero Insertion Force) socket shield. The ATmega328P has 28 pins in DIP package; wire up VCC (pin 7), GND (pin 8, 22), RESET (pin 1), and the SPI pins (MISO-18, MOSI-17, SCK-19). Add a 16MHz crystal between pins 9-10 with 22pF capacitors to ground if you’re burning the standard Uno bootloader (it expects external crystal). Then burn bootloader normally through Arduino IDE. For production runs, people often build programming jigs with pogo pins that contact the chip in seconds. This is much cheaper than buying pre-programmed chips or dedicated programmers for small production runs.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.

  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.

Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.