2
\$\begingroup\$

I'm fairly new to PCB design, and I've been trying to program the microcontrollers on the board I designed with no luck. The board uses an ATmega32u4 and an ATmega328P. I've been trying to program them with a cheap $10 ICSP programmer from Amazon, with no luck. avrdude tells me that "initialization failed" and if I try to force it, I get this: avrdude error message

I tested the pins and confirmed that the ICSP header is properly connected to the microcontrollers. I've been racking my brain trying to figure out what went wrong and the only thing I can think of is maybe it's a bad programmer?

Here's the schematic: Schematic

I appreciate any feedback you might have.

\$\endgroup\$
2
  • \$\begingroup\$ Verify the design. Inspect the soldering under mangnification. Make sure the chips are in the correct orientation and have power. Watch the signals with a scope or at least a cheapie USB based logic analyzer (though only a scope would catch analog issues). Make sure your MCUs have not been previously programmed in a way that disables ISP, requires an external clock, or invokes the maximum clock division. Test the programmer on something else like an Arduino clone. Preprogram an MCU on a good board to produce output and use rework tools to transplant it to the custom board. \$\endgroup\$ Oct 1 '20 at 18:37
  • \$\begingroup\$ One possible trap for hobbyists - If you purchased your ATmega328P or ATmega32u4 from a less-reputable source like eBay, sometimes they're recycled chips, and already fuse-programmed to use the Crystal Oscillator as the clock source, so they won't run without a XTAL. Buy chips from Digikey and Mouser and test again (or you can solder a crystal and two 20 pF caps to the microcontroller pins, program it, and change the fuse back). Also, check RESET and ensure it's working, and try swapping MISO and MOSI in case they're miswired. \$\endgroup\$ Oct 1 '20 at 19:11
1
\$\begingroup\$

Can you program the same chip outside the board? I hope you have put the chip in a DIP socket. Doesn't apply to SMD though. In that case make sure the chip itself isn't faulty. Although rarely, but sometimes it so happens that the chip is configured to expect a crystal oscillator at the XTAL pins. try providing that and see if it runs.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.