Arduino - fuse setting problem on ATmega328P-PU I am trying to do fuse setting on ATmega328P-PU chips using an avr programmer.

I was successfully able to do fuse setting on 3 ATmega328P-PU chips (which I bought from one of the sites - I forgot). So I bought three more from Amazon.

When I execute avrdude -c usbasp -p m328p on the previous 3 chips, I got this response, and was able to do fuse setting.


  avrdude: warning: cannot set sck period. please check for usbasp firmware update.
  avrdude: AVR device initialized and ready to accept instructions
  
  Reading | ################################################## | 100% 0.00s
  
  avrdude: Device signature = 0x1e950f (probably m328p)
  
  avrdude: safemode: Fuses OK (E:FF, H:D9, L:E2)
  
  avrdude done.  Thank you.


But when I execute the same command on the 3 chips I recently bought, I am getting this.

avrdude -c usbasp -p m328p

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.


avrdude done.  Thank you.


I triple-checked the wiring and soldering area. They all look fine.

Is this because the 3 chips I recently bought have a bootloader?  

The description for the chip that works is here.
The chips configured with a bootloader would also have the fuses set for an external clock (the factory default is the on-chip oscillator). Without an external clock they won't work.

I have a sketch that uploads files that also can provide an external clock for this eventuality.

As mentioned on that page an 8 MHz clock is provided on pin D8 of the programming board, so you can connect to D8 on the Uno which you are running the sketch on to pin 9 on the actual Atmega328P chip.

Alternatively find a 16 MHz crystal or resonator and connect that between pins 9 and 10 of your Atmega328P which will provide the clock that it is expecting. If you use a crystal you should also run 22 pF capacitors between each leg and ground, like in this image: