Aakash: @dc42 - I don't think CKOUT is outputting anything (see attached screenshot)
I think you're right, although you'll need to use a sampling frequency much greater than 8MHz to reliably see a 8MHz signal, so check with it set to 24MHz.
If you have an Arduino, you can use it to generate a clock signal to feed to XTAL1. Don't forget to use a potential divider to drop the voltage if it is a 5V Arduino.
PS - is it a 3-terminal resonator? If yes, have you grounded the centre pin? If no, are you certain that the capacitors you connected between the XTAL pins and ground are about the right value, and you haven't accidentally used a value that is much too large?
I think the output looks the same at 24MHz. I have a 3.3V Arduino, what freq signal should I be generating to feed to XTAL1? Also, should I still try connecting XTAL1 and CKOUT?
The datasheet says that resonator has internal caps. I've use 8MHz ceramic resonators in my designs with no problems, although not at 3.3V and I set the low fuse byte to a more appropriate value.
Try feeding a clock signal from your 3.3V Arduino to XTAL1 through a 100 ohm resistor. The frequency doesn't matter much, I would try around 1MHz in the first instance. Leave CKOUT connected to your logic analyser so that you can check that you have a signal there.
Here's a sketch I use to get bursts of a known frequency on the OCR1A pin (pin 9 on an Arduino Uno):
@dc42 Thanks for the suggestion. I'll check for bridging tomorrow. I'll have to order a 100ohm resistor to test out the clock signal feeding. So that'll take a few days. I'll reply back with results then.
If you haven't got 100 ohms, try with 1K or whatever value >100 ohms you do have - it might work.
[EDIT: the datasheet for that resonator very helpfully gives the impedance at various frequencies. Based on that, at a clock frequency of 1MHz, even a 10K resistor may not be too high a value for it to work.]
I installed your sketch and hooked up the ICSP lines and the only serial output I got was "Atmega chip detector." I also tried connecting D9 to XTAL1 through a 1.5K resistor and the same was outputted.
I wouldn't worry about the resistor, but that sounds OK, assuming you followed my wiring. Sounds to me confirmation that it isn't responding to programming.
I wonder if, when you were changing the fuse in the Atmel Studio, you accidentally didn't notice that at the same time the high fuse was set to something that wasn't appropriate (like SPIEN). Once you turn off SPIEN you can't program through the SPI interface.
OK, well I would remove the resonator if that is possible. Then feed the clock (XTAL1) from the clock output on my test sketch with no resistor. No capacitors or anything on XTAL1 or XTAL2. Check the voltages on the other pins (VCC, AVCC). Use the logic analyzer to confirm you are getting the 8 MHz clock in, and that the SPI data is arriving on the correct pins.
I'm not offering a magic bullet here. The symptoms as you describe them do not have a simple solution. I have a Uno here that just stopped working. I am assuming I zapped it with static, but can't be sure what is wrong. Maybe you did that yourself. Who knows? But if the thing isn't working, you may as well explore as many options as you can.
Referring back to the logic analyser screen shots you posted earlier, the middle one (clock connected to XTAL1 through 1.5K resistor) looks exactly as it should. The frequency at CLKOUT is 1/8 of the clock you are feeding it because you have the fuse set to use the clock prescaler. We know that the your mcu wasn't oscillating before because you were unable to detect a clock on CLKOUT, and this explains why your ICSP was unable to read the device signature.
Have you tried using your ICSP to read the fuses, with the clock configured like this?
dc42 - I set your sketch to run at 1MHz and connected it to XTAL1. Then ran "avrdude -c avrispmkII -p m328p -P usb -B250" but no-go unfortunately. I suppose I'll just inquire about getting rework done to replace the mcu and resonator.
Thanks anyways guys, I really appreciate your help. When I get the board back I'll be sure to ask on this thread what fuses to set to what values.
dc42:
Referring back to the logic analyser screen shots you posted earlier, the middle one (clock connected to XTAL1 through 1.5K resistor) looks exactly as it should.
Are you certain? I does look like a nice clean clock signal but I read that horizontal scale as 1/10 of a second.
If I'm reading it correctly, the SCK period would have to be about 1/2 of a second (which may actually work).
Good catch! I assumed that the horizontal scale of the 1st and 2nd images was the same, without looking at the figures. But how could a 1MHz signal on XTAL1 give rise to a signal of about 12Hz on CLKOUT ?
Aakash, are you certain that images 1 and 2 were taken with the same sketch generating the clock signal?