Search code examples
hardwareatmegaatmelmicroprocessorsavrdude

Programming a Atmega32U4 via USBASP


I created my own custom board and added a ICSP header, although I can't seem to program it.

My board has a Atmega32U4 (no external crystal) and I keep getting an error when I use the command:

avrdude -p m32u4 -c usbasp -B 64 -U flash:w:/Users/Jbonnett/Desktop/RGBWstrandtest.ino.hex 

The error:

avrdude: set SCK frequency to 8000 Hz 
avrdude: error: program enable: target doesn't answer. 1 
avrdude: initialization failed, rc=-1
     Double check connections and try again, or use -F to override
     this check.

As you can see I am trying to program the chip in slow mode and I also tried the hardware jumper for slow mode. Although the error is telling me that it can't see my custom board.

The programmer that I am using is this one: https://www.ebay.co.uk/itm/USBASP-USB-ISP-Programmer-for-Atmel-AVR-ATMega328-ATMega32U4-Arduino/322662323277

Here are a couple of photos to show that the custom board is wired up correctly: Programmer powered (no power LED on custom board) Custom board powered programmer Please note that the programmer can be powered by the custom board.

Thanks for any help :)

Edit: My Schematic


Solution

  • Ok so I added a crystal and it works! Even though it has an internal one I have no idea why it didn't work without one :(