Atmega328p dead after setting fuses for 8Mhz Ext.

I’d like 328p to run at 8Mhz & 3.3V with external crystal. No bootloader necessary. Sounds straightforward!

New chip is presumably running at 1Mhz as “-B10” or so is required to burn the fuses.

The fuses burn successfully but as soon as it’s done I can no longer communicate with it even at “-B100” :

avrdude: error: programm enable: target doesn't answer. 1

I use the following to burn the fuses:

avrdude -Cavrdude.conf -v -patmega328p -cusbasp -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m -B10

I lifted and swapped 3 chips one after another each time with exactly the same outcome.
The scope reports XTAL1/2 oscillating at 8.00001. I tried feeding 12Mhz external clock to XTAL1 after providing 5V. Also tried swapping the crystals although that doesn’t seem to be the problem.

I’m using usbasp but never had problems at 16Mhz. I used the very same method for 16Mhz fuses and I was very happy with it before. It worked without a fault on 10 chips from the same batch.

Again the method is:

  1. Put together a board with external oscillator
  2. Test if it oscillates
  3. Burn fuses with “-B10”
  4. Upload sketches etc. Business as usual from now on.

I understand that 99% of the time it’s clock (oscillator) or timing issue.

The question is:

  1. How do I talk to these chips that don’t respond after setting the fuses (revive the 3 chips)?
  2. How to proceed with the new chips to avoid this problem?

Many thanks for suggestions.

Your're setting the high fuses incorrectly - not sure what this will do!

0xDA = 0b1101 1010

That means the BOD level fuses are 010.

According to table 28-4 on page 318 of the datasheet, those three fuse bits should be 111, 110, 101, or 100.

Hmm. I appreciate your comment DrAzzy but I have a feeling it's the extended and not the high fuse that sets BOD. Also high at 0xDA is all over the boards.txt in Arduino IDE.

Anyway this shouldn't affect my ability to program it again should it?

I am willing to lift this chip and try again but it seems unwise without knowing what happened before (this would be a 4th one).

Any more suggestions?

My bad, I was looking at the wrong table in the datasheet (for the smaller ones in the series)

Does anyone have any more suggestions what may be happening?

How should I proceed with the chips I already tried and what to do going forward with the new chips?

I think you have the low fuse incorrectly programmed. Look at this table from the 328 datasheet:

|500x324

Since you have BOD enabled you should have selected SUT1..0 = 01, not 11. Would that matter? I don't know.

Also, if it were me, I wouldn't have programmed the undefined/unused bits in the extended fuse.

I have an 8MHz crystal and an Atmega328 that I've been meaning to put together. I wasn't anticipating any drama. Maybe I will do it today.

I had last configured my Atmega328 for a 16MHz resonator. But looking closely at how I programmed it I'm not sure it's right. It works though.

L:62, H:D9, E:07 -- From the factory, 8MHz internal, divide by 8 L:E2, H:D9, E:07 -- Turned off divide by 8 L:EF, H:D9, E:07 -- I switched to the 16MHz resonator

For the 8MHz crystal.... I just plugged it in and it worked. I didn't even bother with capacitors.

I changed it to what I thought it should be, and then matched what you're shooting for:

L:FF, H:D9, E:07 -- What I think is right for an 8MHz crystal L:FF, H:D9, E:05 -- Turned on BOD (avrdude didn't like it when I tried FD instead of 05) L:FF, H:DA, E:05 -- Changed the bootsize

It's ticking away just fine. I'm running at 5V and also using -B250 option but I doubt that's got anything to do with it. Sorry I couldn't be of more help.

My theory, your load caps are too low or too high. Try with 18pF and 22 pf and see which one works.

Ive had this problem, when the load caps are too high crystal wont start.

mart256: Ive had this problem, when the load caps are too high crystal wont start.

But would it still appear on an oscilloscope to be oscillating at 8.00 MHz as pawpro said?

The scope could be adding parasitic cap.

Oh, I see.

Maybe he could run averdude while holding the scope probe to the crystal pin. :-)

My 8MHz crystal ran okay without any added caps, on a breadboard, but it was +218 ppm (fast). When I added 22pF caps it was off by -14ppm. With 18pF: +9ppm.

jboyton: Oh, I see.

Maybe he could run averdude while holding the scope probe to the crystal pin. :-)

My 8MHz crystal ran okay without any added caps, on a breadboard, but it was +218 ppm (fast). When I added 22pF caps it was off by -14ppm. With 18pF: +9ppm.

Breadboards adds parasitic cap. I use 18 pF on breadboard.

So sadly after placing fourth TQFP from the same batch everything works as if nothing happened. Pretty sure not ESD and unlikely to be heat.

Thanks for all the suggestions and comments! Will report back if I ever find out.