Flashing ATmega32 with a USBasp Programmer

The ATmega32 is a versatile 8-bit AVR microcontroller widely used in legacy and learning applications. The USBasp is a compact and affordable in-system programmer (ISP) that allows flashing firmware over the ISP interface.

Requirements

Pinout Reference

Connect the ISP pins as follows:

Installing AVRDUDE

sudo apt update
sudo apt install avrdude
  

Check Device Connectivity

avrdude -c usbasp -p m32
  

Flash the Firmware

avrdude -c usbasp -p m32 -U flash:w:main.hex:i
  

Read and Set Fuses

# Read fuse values
avrdude -c usbasp -p m32 -U lfuse:r:-:i -U hfuse:r:-:i

# Example: Set fuses for external 16 MHz crystal
avrdude -c usbasp -p m32 -U lfuse:w:0xFF:m -U hfuse:w:0xC9:m
  

Troubleshooting Tips

← Back to Notes