Electrical – Can not flash atmega328p with usbasp

atmega328patmel-studioprogrammerusbasp

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?

Best Answer

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).
Related Topic