I have been using a USBasp board and AVRDUDE to successfully program ATtiny13 chips. I thought I'd have a look at the chip from my Arduino (ATmega328P), but AVRDUDE can't seem to read the chip.

$ ./avrdude -p m328p -c usbasp

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.

avrdude.exe done.  Thank you.

I have checked the connections on the breadboard several times (I took the chip off the Uno and connected the pinout of the USBasp to the chip directly). Does the ATmega328P need an external oscillator to be programmed (there is one on the USBasp board)?


1 Answer 1


The ATmega on an Uno is clocked by an external crystal, in contrast to an off the shelf AVR which is configured for its internal RC resonator. This means that for reading the ATmega you either need to apply an external clock, say 1 ~ 20MHz, or use the ICSP header that is on the Uno board to communicate with the controller. This 6 pin ICSP header is actually meant for programming the AVR in circuit, hence 'In Cicruit Serial Programmer'.


Your Answer

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

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