1
\$\begingroup\$

I have a cheap Chinese USBASP clone and it works fine with my ATtiny13A, but I always get this:

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.

This is not actually a problem, because I successfully programmed my ATtiny13A several times, also using a -B 250 argument when my fuses were set to a lower clock speed, so my USBASP definitely works. But now I want to program my ATmega328P and I get this:

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: programm enable: target doesn't answer. 1 
avrdude: initialization failed, rc=-1
     Double check connections and try again, or use -F to override
     this check.

I do not know what the fuses are of this chip, I changed it some time ago and now I can't even read them. I tried to connect a crystal to the atmega, and I also tried without any crystals and nothing worked. Can this chip be dead? I don't think I applied high voltages to it. (How) can I fix it? Please help me.

\$\endgroup\$
  • \$\begingroup\$ "an this chip be dead?" never change fuses and not remember/know what you did. It's most likely unrecoverable. who knows what it wants on the crystal now?! ATMEGA328P can be horrible things to flash/burn fuses for, make sure you are well prepared... \$\endgroup\$ – KyranF Jul 27 '15 at 19:39
  • \$\begingroup\$ Get your usbasp updated. The firmware can be found online and is compatible. Borrow a friend's usbasp if you have to. Once that's done, you can change sck to a really slow clock. If you cannot update, see if the usbasp has solder jumpers, headers. Some versions can be set to slow by shorting the jumper. If that falls, try to directly drive xtal1 \$\endgroup\$ – FRob Jul 27 '15 at 19:47
  • \$\begingroup\$ I can successfully slow the sck on my usbasp, I already did it with my ATtiny13A, but with my ATmega328P it still gives the "programm enable: target doesn't answer. 1" error. \$\endgroup\$ – Tym3k Jul 27 '15 at 20:00
  • 1
    \$\begingroup\$ This is perhaps a lesson in why it is a good idea to avoid the "cheap Chinese" devices. I recommend the pocket AVR programmer from Sparkfun. I have not had any problems with it thus far, and best of all it is still quite cheap. sparkfun.com/products/9825 \$\endgroup\$ – David Freitag Jul 27 '15 at 20:32
  • \$\begingroup\$ You can try applying 1MHz clock to XTAL1 pin. \$\endgroup\$ – v.m. Jul 27 '15 at 20:34

Your Answer

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

Browse other questions tagged or ask your own question.