ESP32 Bit Pirate home
  • AVR
  • Intermediate
  • 10 min
  • AVRDUDE

Recipe · Intermediate · AVR ISP

How to program an AVR with AVRDUDE

The adapter wiki documents an AVRDUDE mode that exposes the legacy Bus Pirate binary SPI protocol used by avrdude -c buspirate. CS is used as the AVR RESET line.

Firmware dump and backup files.
This workflow is for ISP programming through RESET, SCK, MISO and MOSI.

Wiring View

AVR BP adapter RESETCS / RESET GPIOSCKSCK GPIOMISOMISO GPIOMOSIMOSI GPIOGNDGNDVCCpower, if your ...
Generated from the wiring summary: AVR to BP adapter.
Step 1

Commands

From the computer side, AVRDUDE uses the exposed serial port.

Host workflow

  1. Put ESP32 Bit Pirate in the AVRDUDE Bus Pirate SPI adapter mode from USB adapter selection.
  2. Wire RESET/CS, SCK, MISO, MOSI and GND.
  3. Probe the chip with a low SPI frequency before reading or writing flash.
  4. Read fuses before changing them.

Result

What success looks like

AVRDUDE detects the part signature first. Treat writing flash or fuses as a separate step after the target has been identified reliably.

Troubleshooting

  • RESET is not wired to the adapter CS/RESET GPIO.
  • MISO and MOSI are swapped.
  • SPI frequency is too fast for the current AVR clock.
  • Target is not powered or ground is not shared.
  • Wrong AVR part name passed to -p.

Next steps

  • Read flash before writing a new image.
  • Read fuses and save the output before modifying boot or clock settings.
  • Use the browser AVR Programmer if you want a Web Serial workflow instead of a local AVRDUDE command.

AVRDUDE Bus Pirate SPI FAQ

What does AVR ISP need besides SPI signals?

AVR ISP needs reset control in addition to SCK, MOSI and MISO so the target can enter programming mode. The adapter maps that control line into the wiring expected by AVRDUDE.

Why start with a low SPI frequency?

Some AVR targets run from a slow clock, wrong fuse setting or fresh internal oscillator. A conservative spifreq is more reliable for first contact and fuse readout.

What should I save before writing firmware?

Read flash and fuses first, save the output, and confirm the exact AVR part passed to -p. Wrong part selection or fuse changes can make recovery harder.

Go deeper