0
votes

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

2
add schematics of the custom board to question. is the 2x3 header a standard Arduino ISCP header? - Juraj
Hi @Juraj I added my schematic :) - Jamie Bonnett
do you have a not-by-you-made 32u4 board? you could try the programmer first with that - Juraj
Sorry I don't no - Jamie Bonnett

2 Answers

1
votes

With the limited information, there are many possibilities, you could check the following, though not a comprehensive list, should narrow it down:

(1) Try using the -F parameter to check if you can get a little further

(2) Check if the USBAsp works with a standard 32u4 board

(3) Check if the ISP header connections are correct, sometimes the labeling of the pins might be reversed due to any mistake in the schematic/layout/fab

(4) The Fuses on the 32u4 may be set to use external oscillator (though I have never seen this setting on factory 32u4, default is always internal RC), in which case we need an external crystal to program.

0
votes

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 :(