0

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

4
  • add schematics of the custom board to question. is the 2x3 header a standard Arduino ISCP header? Commented Dec 6, 2018 at 21:22
  • Hi @Juraj I added my schematic :) Commented Dec 8, 2018 at 0:06
  • do you have a not-by-you-made 32u4 board? you could try the programmer first with that Commented Dec 8, 2018 at 10:13
  • Sorry I don't no Commented Dec 8, 2018 at 22:33

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

6 Comments

Hi @coolbreeze, I did try the -F argument with no joy. I can't see the USBAsp not working although I have no information on compatibility. Here is my schematic Imgur. Any idea how to set the correct fuses? I haven't got the slightest clue when it comes to them.
If you could post the output of avrdude when using the -F option, it would help. Also add the -v option for verbose output.
ISP Header seems to be ok from the schematic, need to check if there are any connectivity/soldering problems on board. Is the chip a new 32u4 from the factory( direct from one of the Atmel dealers) or has this been programmed previously (by you or sourced from one of the sources who pre-program the chips with code)?
I purchased it from here, although I can't see if it ships with a bootloader pre-installed.
Sorry I must have forgot the link :( Link to ATMega32U4-MUR See section 21.4 in the documentation.
|
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.