Crystals not oscillating in custom board design using ATMEGA328pb

Continuing the discussion from Some 16MHz crystal not working well with ATMEGA328 and 22pF:

In the link above, @CrpssRoads suggests changing the fuse settings from "Low Power Xtal Osc" to "Full Swing Crystal Oscillator"

How is this done? I designed a simple board using the Atmega328PB, and am using an Arduino Uno as the programmer. But, because the oscillator is not running (no oscillations measured at pins 7 and 8 of micro), I can't get past this error:
" avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

Failed programming: uploading error: exit status 1"

There is not a lot of info in this error message, and I can't figure out how to make it verbose ....

I will try larger caps to see if the issue is indeed inadequate loading on the xtal.

Thanks for any hints.
Jorge

Post the schematic for your design, and a photo of the assembled PCB.

Keep in mind that with a genuine, brand new ATmega chip, the fuse settings are for 8 MHz internal clock with the CKDIV8 fuse set, for a CPU clock frequency of 1 MHz. The AVR ISP programmer clock frequency must be 250 kHz or less.

2 Likes

Have you ever been able to program the processor?

Bear in mind that measuring requires high impedance probes. Folks have reported the oscillator stopping just by touching either pin.

How did you disable reset?

1 Like

Thanks @jremington -- I'm using Arduino as ISP as the programmer. It seems its clock is set to 125kHz -- measured, I don't know where this is set...

@coding_badly, no, I have yet to be able to program the processor. I've tried a different crystal, and different caps (18pF, 24pf, 27pf, and 33pf). The xtal expects a load capacitance of 18pF, so I figured 18pF-27pF would be reasonable values (loading on the xtal would be between 9pF through13pF + Cstray -- the 33pF is a litle high, but tried it anyway).
My layout is not great, but nonetheless,I'd expect to be able to get the oscillator started.

Regarding probing the crystal, I'm probing the clockout pin on the micro to not load the xtal with the scope probes (which would add another 18pF or so). Perhaps it needs to be configured to XCK?

I have not disabled reset, but I have a small capacitor from Reset to gnd (is that what you are asking?)

Thank you.

Who knows? It may be completely wrong. Why haven't you posted the requested details?

1 Like

Assembly.PDF (503.6 KB)

Then the crystal is irrelevant. So much so that nothing needs to be connected to the pins. The processor is always programmable when delivered from the factory.

Small as in?

Yup.

working on it.....should be up now

0.1uF

Yeah. Way too small. I think the recommendation is 10 μF.

Yup. That's what I've used. With consistent success.

More info....I do not connect the VCC pin from the ICSP connector from the Arduino board to the target because the target has its own power, and I didn't diode-OR the sources of the +5V net...I will do that in the next spin ---

tried the 10uf, same result. The error is not particularly descriptive ---it doesn't tell me what signature it is reading. How do I make it verbose to see if I get more info from the failure?

used the old arduinio IDE, and saw that the signature read is 0x00000, which is what had led me to believe the xtal was not oscillating

The crystal won't oscillate until you have set the fuses to enable the oscillator.

Post the schematic.

Schematic is posted in post #7, assembly.pdf..

How do I set the fuses?

Set the fuses with an ISP programmer. I strongly recommend this one.

1 Like

but I'm using the Arduino UNO as the programmer....can I not do this?

In theory, yes. Clearly you are doing something wrong, but you haven't provided enough information for people to guess what that is.

please let me know what additional information to provide. I uploaded the schematic, the assembly. I'm using the Arduino UNO as programmer. I'm connecting the ICSP signals 1to1 (ie, MOSI to MOSI, MISO to MISO, etc). I"m not connecting VCC from the UNO as programmer to the target
I've tried various capacitor values (listed in a previous post).

I don't know what else to add --please ask me for what you need or what other/additional information is need -- I"m not being difficult or coy, i just don't know