user38038: 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.


user10794: 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:


38038: <p>I am trying to do fuse setting on ATmega328P-PU chips using an <a href="https://rads.stackoverflow.com/amzn/click/B071P2LCC9" rel="nofollow noreferrer">avr programmer</a>.</p>

<p>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 <a href="https://rads.stackoverflow.com/amzn/click/B018ZR3F7O" rel="nofollow noreferrer">from Amazon</a>.</p>

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

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

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

<pre><code>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.
</code></pre>

<p>I triple-checked the wiring and soldering area. They all look fine.</p>

<p>Is this because the 3 chips I recently bought have a bootloader?  </p>

<p>The description for the chip that works is here.</p>

<p><a href="https://i.stack.imgur.com/nqalo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nqalo.png" alt="enter image description here"></a></p>
 10794: <p>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.</p>

<p>I have a <a href="http://www.gammon.com.au/uploader" rel="nofollow noreferrer">sketch that uploads files</a> that also can provide an external clock for this eventuality.</p>

<p>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.</p>

<p>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:</p>

<p><a href="https://i.stack.imgur.com/tZRF5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tZRF5.jpg" alt="Atmega328 with crystal"></a></p>
