Help burning bootloader with avrdude

I want to program an atmega168 on a protoboard. Right now it have nothing more than the chip, this is, no clock source. If i put the chip on the arduino board, it can be programmed from the IDE without error (programmer works), but i can't do it on the protoboard.

I don't know if i'm missing something...

this is what i'm executing: avrdude -p m168 -P usb -c usbtiny -U flash:w:ATmegaBOOT_168_diecimila.hex

i've tried many variations and always got this error:

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

avrdude done.  Thank you.

Where is the programmer-ID "usbtiny" coming from?

Also, if your mega168 is configured to be running off of an external clock, you will not be able to program it without an external clock selected.\

  • Ben

usbtiny is a usb programmer added recently to avrdude 5.5, and it works!

the chip i'm trying to program is a blank chip (i have 3 spare chips), so it's supposed to have internal oscilator configured, isn't it? also, can't i change the fuses without an external clock?

If it’s a blank chip then yes, it’s configured to run off the 8 MHz internal oscillator, and the CKDIV8 fuse will be programmed, meaning the CPU clock will be 1 MHz. If you’ve already used the Arduino IDE to load the bootloader, then it’s been reconfigured to run off the external clock and will no longer be programmable via ICSP without an external clock connected (this goes for fuses, too).

I don’t know anything about the usbtiny, so I can’t really help you there. You need to make sure that your programmer’s ISP frequency is less than a quarter of your clock frequency (so it should be less than 250 kHz). It probably is, but this is worth mentioning.

Are you sure you have your ISP connections right on your protoboard?

  • Ben

I've checked it many times, it should be well connected.

I'm really lost.

mmmmmm, i think those chips had some sort of fuse configuration, since i can program them from the command line and in the arduino board, using the 16MHz clock. I bought them with my arduino, but the store said they were blanked. Before programming they didn't work, so i think they were blanked but with fuses configured for arduino.

Do you have a way of reading the fuses from the mega168 while it’s in your Arduino?

  • Ben