0
\$\begingroup\$

While uploading program to atmega328 I accidentally disconnected it from power. After that I get "target doesn't answer" message while trying to upload.

I am using USBasp programmer, connections are correct. I would like to know what exactly happened. Its third chip that died because of power loss while uploading.

Can someone explain what it could possibly be?

\$\endgroup\$
1
  • 2
    \$\begingroup\$ you've probably set one of the fuses that can only be cleared using a parallel programmer (eg disabled the reset pin), or perhaps you've bricked it. \$\endgroup\$ Commented Jan 4, 2019 at 23:36

2 Answers 2

0
\$\begingroup\$

In my experience, @Jansen's comment is basically correct. The common thing that I've done in the past is accidentally programmed the fuses so that the clock source is for an external crystal, for example. If you do that, and you don't have a crystal (and load capacitors) attached in the right frequency range for the fuse settings, none of the chip's functions will work anymore, including programming. It's very difficult to know exactly what setting you inadvertently changed without the use of a high-voltage parallel programmer at that point. But if you've got a crystal circuit handy, you could try connecting it to the XTAL pins and see if it helps revive the program-ability of the device.

\$\endgroup\$
3
  • \$\begingroup\$ This actually happens after "avrdude -v -pm328 -cusbasp -Uflash:w:test.hex:i" command. Are fuses every upload using this command cleared and set? \$\endgroup\$
    – Etwus
    Commented Jan 5, 2019 at 10:12
  • \$\begingroup\$ I'm not sure, but you can add -v -v -v -v -v to get a whole lot of verbose output and see for yourself what's going on. \$\endgroup\$
    – vicatcu
    Commented Jan 5, 2019 at 15:23
  • \$\begingroup\$ I will try this after I buy new controllers to see what happened. Thanks. \$\endgroup\$
    – Etwus
    Commented Jan 5, 2019 at 15:48
0
\$\begingroup\$

I figured it out. While chip is erased, fuses are erased too (l:0xff h:0xff e:0xff), and USBasp can't set them back if atmega losses power before whole uploading is done.

\$\endgroup\$

Your Answer

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

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