Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Arduino & Microcontrollers

Arduino Bootloader: Burning Using ICSP and USBasp

Arduino Bootloader: Burning Using ICSP and USBasp

March 11, 2026 /Posted byJayesh Jain / 0

Every Arduino board you pick up comes pre-loaded with a small but critical piece of software called the bootloader. Without it, your Arduino cannot receive sketches over USB. But bootloaders fail, get overwritten, or simply need replacing — and that is where ICSP (In-Circuit Serial Programming) and the USBasp programmer come in. This tutorial walks you through everything you need to burn an Arduino bootloader from scratch, even if your board is completely bricked.

Table of Contents

  1. What Is an Arduino Bootloader and Why Does It Matter?
  2. Tools You Need: ICSP Header and USBasp Programmer
  3. Understanding the ICSP Pinout
  4. Wiring USBasp to Arduino
  5. Burning the Bootloader via Arduino IDE
  6. Burning with AVRDUDE Command Line
  7. Troubleshooting Common Errors
  8. Frequently Asked Questions

What Is an Arduino Bootloader and Why Does It Matter?

The Arduino bootloader is a small program — typically under 2 KB — that resides in the upper flash memory of the ATmega microcontroller. Its sole job is to listen on the serial (UART) interface for a few seconds after power-up. If it detects an incoming sketch from the Arduino IDE, it writes that sketch to program memory. If it hears nothing, it jumps to whatever user sketch is already loaded.

This mechanism lets you program your Arduino over a simple USB cable without needing a dedicated hardware programmer every time. The bootloader essentially acts as a tiny firmware updater built into the chip itself.

When do you need to re-burn the bootloader?

  • You accidentally wrote to the bootloader section with AVRDUDE directly.
  • You changed the fuse bits incorrectly and the board no longer responds.
  • You received a bare ATmega328P chip from a supplier and want to use it on a custom PCB.
  • Your Arduino IDE keeps throwing “avrdude: stk500_recv(): programmer is not responding” even with correct drivers.
  • You want to switch from Optiboot (UNO default) to a custom bootloader for faster uploads.

Understanding this process also gives you insight into fuse bytes — the non-volatile configuration bits that control oscillator selection, brown-out detection, bootloader size, and more. Burning a bootloader resets fuses to safe defaults, which is often the real reason the process fixes a broken board.

Recommended: Arduino Uno R3 Beginners Kit — Includes the Arduino Uno R3 with an exposed ICSP header, making it the easiest starting point for bootloader burning experiments.

Tools You Need: ICSP Header and USBasp Programmer

You do not need expensive equipment to burn a bootloader. Here is the complete list:

  • USBasp programmer — A low-cost open-source AVR programmer. Costs around Rs 150 to Rs 250 in India and is widely available.
  • 10-pin to 6-pin ICSP adapter cable — USBasp outputs a 10-pin IDC connector; most Arduinos have a 6-pin ICSP header. The adapter is usually bundled with USBasp kits.
  • Target Arduino board — The board whose bootloader you want to burn or replace.
  • USB cable — To power the target if the USBasp does not supply power (see jumper setting below).
  • Arduino IDE — Version 1.8.x or 2.x, both work fine.
  • libusb-win32 driver — Windows users must install this for USBasp to be recognised. Use Zadig tool for easy installation.

The USBasp programmer uses the SPI (Serial Peripheral Interface) protocol to communicate directly with the AVR’s programming interface, bypassing the bootloader entirely. This is why it can recover a completely dead board — it talks to the chip at the hardware level.

Recommended: Arduino Mega 2560 R3 Board — Features two accessible ICSP headers (one for the ATmega2560, one for the ATmega16U2 USB bridge), making it ideal for learning advanced bootloader techniques.

Understanding the ICSP Pinout

The ICSP (In-Circuit Serial Programming) header on Arduino boards is a 2×3 arrangement of 0.1-inch pitch pins. Knowing the pinout is essential — connecting it incorrectly can damage both the programmer and the target board.

Standard Arduino ICSP pinout (looking at the board with the header facing you):

[ MISO ]  [ VCC ]
[ SCK  ]  [ MOSI ]
[ RST  ]  [ GND ]

Pin descriptions:

  • MISO (Master In Slave Out) — Data from the target chip to the programmer.
  • VCC — 5V power supply (either from programmer or external).
  • SCK (Serial Clock) — Clock signal from programmer to target.
  • MOSI (Master Out Slave In) — Data from programmer to target chip.
  • RST (Reset) — Held low by programmer during programming to enable SPI mode.
  • GND — Common ground.

The USBasp 10-pin cable has a notch on one side — always align the notch with pin 1 (marked with a dot or triangle on the PCB). On most Arduinos, pin 1 of the ICSP header is MISO and is marked with a small square pad or dot.

Warning: Never connect the USBasp while both the programmer and target are powered from separate sources without a common ground. Always verify polarity before powering up.

Wiring USBasp to Arduino

If you have the 10-pin to 6-pin adapter cable, simply plug it in — the adapter handles the pin mapping. If you are wiring directly with jumper wires, use this mapping:

USBasp Pin Arduino ICSP Pin Signal
MOSI (Pin 1) MOSI Data to target
GND (Pin 2) GND Ground
SCK (Pin 3) SCK Clock
MISO (Pin 4) MISO Data from target
RST (Pin 5) RST Reset control
VCC (Pin 6) VCC Power (optional)

Power considerations: USBasp has a jumper (JP1 or similar) to enable or disable 5V target power. If your Arduino is powered from its USB port, disable the VCC output on USBasp to avoid a voltage conflict. If the Arduino has no other power source, enable USBasp’s VCC output.

Burning the Bootloader via Arduino IDE

The Arduino IDE makes bootloader burning surprisingly straightforward:

Step 1 — Install USBasp drivers (Windows only):
Download Zadig, select USBasp from the dropdown, choose libusb-win32, and click Install Driver. Linux and macOS usually recognise USBasp out of the box (add a udev rule on Linux if needed).

Step 2 — Connect hardware:
Plug the USBasp into your PC’s USB port. Connect the ICSP cable from USBasp to the target Arduino’s ICSP header.

Step 3 — Select the correct board:
In Arduino IDE, go to Tools and select the board whose bootloader you want to burn (e.g., Arduino Uno for an ATmega328P board).

Step 4 — Select the programmer:
Go to Tools then Programmer and select USBasp.

Step 5 — Burn:
Go to Tools then Burn Bootloader. The IDE will call AVRDUDE in the background. You should see the USBasp LEDs flicker, and after 15 to 30 seconds the IDE will display “Done burning bootloader”.

That is it. Your board is now restored. You can disconnect the USBasp, plug in the regular USB cable, and upload sketches as normal.

Recommended: Arduino Nano Every with Headers — Uses the ATmega4809 MCU with a different bootloader (UPDI-based), a great next step once you understand traditional ICSP bootloader burning.

Burning with AVRDUDE Command Line

For more control — especially when flashing custom bootloaders or setting fuse bits manually — use AVRDUDE directly from the command line. AVRDUDE ships with the Arduino IDE and is located inside the IDE’s installation directory.

Basic AVRDUDE command to burn Optiboot (ATmega328P):

avrdude -c usbasp -p m328p -U flash:w:optiboot_atmega328.hex:i -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0x05:m

Parameter breakdown:

  • -c usbasp — Specifies USBasp as the programmer.
  • -p m328p — Target device is ATmega328P.
  • -U flash:w:optiboot_atmega328.hex:i — Write the bootloader hex file to flash memory.
  • -U lfuse:w:0xFF:m — Set low fuse byte (external 16 MHz crystal, full swing).
  • -U hfuse:w:0xDE:m — Set high fuse byte (512-word bootloader, SPIEN enabled).
  • -U efuse:w:0x05:m — Set extended fuse byte (brown-out at 2.7V).

Finding the bootloader hex file: On Windows, look in C:Program FilesArduinohardwarearduinoavrbootloadersoptiboot. On Linux, check ~/.arduino15/packages/arduino/hardware/avr/.

Slow SCK for 1 MHz chips: If you are programming an ATmega chip running at 1 MHz (factory default, internal oscillator), add -B 3 to reduce USBasp clock speed. Without this, AVRDUDE will fail because the SCK frequency cannot exceed 1/4 of the target clock.

avrdude -c usbasp -p m328p -B 3 -U flash:w:optiboot_atmega328.hex:i
Recommended: Arduino Pro Mini 328 – 3.3V/8 MHz — Has no USB chip, so ICSP and USBasp are the primary way to burn its bootloader. A great board to practice the command-line AVRDUDE workflow.

Troubleshooting Common Errors

Error: avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc
The USBasp is not recognised by your OS. On Windows, install libusb-win32 via Zadig. On Linux, add the udev rule and reload udev rules.

Error: initialization failed, rc=-1 — Double check connections
This almost always means a wiring problem. Verify MOSI/MISO are not swapped, RST is connected, and the target has power. Try enabling USBasp’s VCC output if the target lacks independent power.

Error: avrdude: warning: cannot set sck period
This is a USBasp firmware warning, not an error. It happens when using an older USBasp firmware. The burn usually succeeds. Update USBasp firmware with a newer version to eliminate the warning.

Error: avrdude: stk500_getsync() attempt N of 10: not in sync
You selected the wrong board in Arduino IDE. Make sure the board selection matches the actual chip on your target.

Board still not uploading after bootloader burn:
Check that the correct COM port is selected. Try pressing the Reset button on the Arduino just as you click Upload — the bootloader has a short listen window. Also verify the baud rate matches Optiboot’s expected 115200.

Recommended: Arduino Starter Kit with 170 Pages Project Book — Includes an Arduino Uno R3 plus a guided project book covering fundamentals, making it the best all-in-one kit for learning while you practice bootloader techniques.

Frequently Asked Questions

Can I use one Arduino as a programmer to burn another’s bootloader?

Yes. Arduino IDE includes an “ArduinoISP” example sketch under File then Examples then 11.ArduinoISP. Upload it to a working Arduino, then select Tools then Programmer then Arduino as ISP to burn the bootloader on the target. The wiring uses the same ICSP signals but goes through digital pins 10 to 13 instead of the ICSP header.

Will burning the bootloader erase my sketch?

Yes. The burn bootloader process performs a chip erase before writing the bootloader hex. Your existing sketch will be erased. Back up the sketch source code before proceeding.

What is Optiboot and why is it better than the original bootloader?

Optiboot is the bootloader used on modern Arduino Uno boards. It occupies only 512 bytes versus the original 2 KB bootloader, which gives you 1.5 KB more flash for your sketches. It also supports a higher upload baud rate of 115200 bps, making uploads faster. On most boards produced after 2012, Optiboot is already the default.

What fuse bytes should I use for a 16 MHz crystal oscillator?

For a standard Arduino Uno with a 16 MHz external crystal: lfuse=0xFF (full-swing crystal oscillator, no clock divider), hfuse=0xDE (Optiboot 512-word section, SPI enabled, EESAVE disabled), efuse=0x05 (brown-out at 2.7V). These are the values Arduino IDE sets automatically when you select Burn Bootloader.

Can I burn a bootloader onto a standalone ATmega328P chip not on an Arduino board?

Absolutely. Wire the chip according to the ATmega328P datasheet pinout, providing a 16 MHz crystal with 22 pF capacitors, a 10K pull-up on RESET, and power (VCC and AVCC to 5V, GND). Connect USBasp to the appropriate MOSI/MISO/SCK/RST/GND pins. Run the AVRDUDE command with -B 3 flag since the chip ships running at 1 MHz internally. After burning, you have a fully functional Arduino-compatible standalone chip.


Ready to start your Arduino projects?
Explore our full range of Arduino boards and accessories at Zbotic.in — India’s trusted source for electronics components with fast shipping.
Tags: Arduino, AVR, Bootloader, ICSP, microcontroller, programming, USBasp
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
ESP32 SPIFFS and LittleFS: Sto...
blog esp32 spiffs and littlefs store files in flash memory 595303
blog iot smoke and gas alert system mq2 esp32 whatsapp 595312
IoT Smoke and Gas Alert System...

Related posts

Svg%3E
Read more

Arduino Batch Programming: Flash Multiple Boards Quickly

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Based Radar System with Ultrasonic Sensor

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Automatic Plant Monitor: Sunlight, Moisture, Temperature

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Lie Detector: GSR Sensor Polygraph Project

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Metal Detector: Build a Treasure Finder

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading

Add comment Cancel reply

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

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now