I'm using an USBasp as a programmer for programming an ATtiny85. I can upload code to the ATtiny85 without any issues. I then tried to burn the bootloader to change the clock to 16 MHz (PLL), which worked at first. However when I tried uploading new code I got hit with this error message.
avrdude: set SCK frequency to 187500 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
Failed programming: uploading error: exit status 1
Now I can't upload or do anything with the MCU. Have any of you encountered this problem before?
Oh yea, almost forgot. I'm using the ATTinyCore by Spence Konde.
I hope you guys can help:)
Hi @mowarrad1. I have experienced this error under either of the following conditions:
Incorrect wiring between the USBasp and the target (e.g., having the cable plugged into the ICSP header backwards)
Target clock is <=1MHz, USBasp is flashed with the official "Fischl" firmware, and the "Slow SCK" jumper is not shorted.
On this common USBasp model, the "Slow SCK" jumper is marked "JP3" on the PCB silkscreen:
Hey @ptillisch
Sorry for the late reply! And thank you for answering:)
I'm pretty sure it's connected correctly, else I wouldn't be able to upload any code:)
Honestly I don't know if its flashed with Fischl firmware, I bought it from a local retailer. Do you maybe know how I can check which firmware is installed. Should I update the firmware eitherway?
Your claim of being able to upload contradicts your previous statement:
There is a nice alternative firmware that was produced by some of the Arduino community members:
However, the firmware update process is fairly complex and the firmware the USBasp comes with is perfectly fine for most use cases. So I would say that you should only update the firmware if you have a specific reason to do so, or if you think performing a firmware update is something you would enjoy just for the experience (accepting the risk that you might "brick" your USBasp in the process). If the problem still occurs even with JP3 shorted then I don't think updating the USBasp firmware will solve the problem you are experiencing currently.
I meant, if I don't burn the bootloader in MCU at all then I can upload new code anytime I want. The problem is when I do burn the bootloader, it gives me the error as shown before if I want to upload new code.
Ohh Yea, I tried burning the bootloader on a new ATTiny85 with an UNO instead and there are no issues there. I don't get any errors if I try to upload new code after burning the bootloader.
I want to get the usbasp working as intended than using an UNO