My usbasp was working fine.I could burn programme to atmega328p.But last night i wanted to cahnge the clockspeed by clock_prescale_set ( clock_div_t x ). after that it burned successfully and changed the clock speed.But I couldnot burn any new program.it shows this error massage in avr studio:

avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.

avrdude.exe: error: programm enable: target doesn't answer. 1

avrdude.exe: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check.

What is the problem and how to solve it?

  • \$\begingroup\$ I tried to program an atmega328 before and after many attempts it worked only when I connected an external oscillator. AVR pocket programmer is better. \$\endgroup\$ – pantarhei Dec 17 '18 at 16:13

Many potential issues:

  1. You have changed the devider to 8 and now your Atmega is clocked 1MHz. You need to slow down your usbasp by the slowSCK jumper. It is possible also by the command line option -B x but unfortunately your usbasp firmware does not support it. You need another usbasp to flash the new software.
  2. You have changed other fuse bits - for example you set the external clock source. Then you need to connect the clock from the other source to the Atmega clock pin.
  3. I you have changed something else (for example the function of the reset pin) your uC is bricked and it can be only unbricked by using the high voltage programmer. You can build your own one (take a look here).
  • \$\begingroup\$ thanks,I think 1st potential isuue is the cause.Btw can i set the clock of atmega by using external oscillator? \$\endgroup\$ – Zarzisur Dec 20 '17 at 20:46
  • \$\begingroup\$ yes you can. If you plan to use uart you actually need to clock it this way. \$\endgroup\$ – P__J__ Dec 20 '17 at 20:47
  • \$\begingroup\$ But he has to program new CKSEL fuses to enable external clock which he can't do now. @Zarzisur, if you have another Atmega328p or any Arduino you can use ArduinoISP firmware to make it into another AVR programmer. With this use can either try to flash new fuses to your current Atmega328p or flash your USBasp to fischl.de firmware which does supports setting SCK period. \$\endgroup\$ – NStorm Apr 17 '19 at 6:53

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.