[SOLVED] Set Low Fuse Bit, Now Can't Program over ISP

Aakash:
I set REQUIRED_FREQUENCY (128000) and connected the logic analyzer to CLKOUT.

When connecting the source to XTAL1 nothing happens to CLKOUT. But when connecting it to XTAL2 the attached screenshot is the output.

EDIT: When D9 is connected to XTAL2, I ran this command "avrdude -c avrispmkII -p m328p -P usb -B250" and it still failed to initialize.

Very strange on several counts:

  1. XTAL1 is the oscillator input, XTAL2 is the output. So it should be much easier to get a clock by injecting a signal into XTAL1 than into XTAL2. Are you sure you have nothing apart from the resonator connected to XTAL1? Is the 1.5K resistor still in place, or did you remove it?

  2. Your photo suggests that you have a 128KHz signal on CLKOUT. However, you have the CKDIV fuse in place, according to your earlier post. So the CLKOUT frequency should be 1/8 of the input clock frequency, not equal to it.

  3. With a 128KHz clock, you should be able to program the device via ICSP, as long as the high fuse byte hasn't been changed to disable ICSP programming.

Aakash:
For future reference, what fuses should I be using in order to make the atmega328p use the 8MHz resonator?

I use AVR® Fuse Calculator – The Engbedded Blog in conjunction with the data sheet to work out the fuse bytes. For an 8MHz resonator I use a low fuse byte of 0xEE.