Crystal oscillator questions on the ATmega328P

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Section 13.3 of the ATmega328P datasheet, "Low Power Crystal Oscillator", states "It gives the lowest power consumption, but is not capable of driving other clock inputs..."  What exactly are the "other clock inputs"?  What can the low power crystal not drive that the full swing crystal can?

 

Also, is there a list of approved crystals for this uC?  The datasheet and ANs list suggested parameters, but I've not found specific, approved, part numbers.

 

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When using full swing you can for example use XTAL2 pin as an external clock for another chip.

As to crystals, any 0.5$ crystal always worked for me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The crystal makes no difference. That setting is for a "full swing" oscillator or for a "low power" oscillator. The full swing version produces more like a square wave on the XTAL2 pin while the low power one is more like a sine on that pin. The low power one is more susceptible to external noise. The full swing one uses more power. Same crystal.

 

There are many, many, crystals that meet the specs. I guess that the powers that be have decided not to recommend any specific one.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

Last Edited: Thu. Feb 1, 2018 - 07:44 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you just want one crystal, then find a dud PC motherboard and grab the crystal off it!
In terms of the crystal oscillating, most should work. The main thing will be how accurate it keeps the time- that’s where choosing one with the right specs comes in. You can tweak the frequency by changing the load capacitance by using different value caps or a trimmer cap.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Visovian wrote:

When using full swing you can for example use XTAL2 pin as an external clock for another chip.

 

Aha!  That's what I couldn't figure out.

 

Another question:  when choosing the crystal, is there any advantage to using a higher or lower capacitance one?  For example, the crystal that otherwise fits my needs is available in 18pF or 20pF.  Does it matter which to use?  Most of heir specs (freq stability, freq tolerance, temp, size, etc.) are the same.  The only difference is load capacitance and ESR.  One calls for 18pF and has 80Ohm ESR and the other calls for 20pF and has 60 Ohm ESR (the 20pF is also almost twice as expensive, but for single units it's not important).

 

For reference, these are the two I'm currently looking at:

https://www.digikey.com/product-...

https://www.digikey.com/product-...

 

(Yes, I know I can get cheaper ones.  But I'd rather buy from a reputable vendor, these have a large temp range which is important to the project, and in single quantities $.05 or $1 really doesn't matter.)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There SHOULD be very little difference in operation (frequency accuracy, power consumption, and such) between crystals with different load capacitances. Here is what I believe happens:

 

The crystal manufacturer has a calibration "jig" that holds the blank crystal. It has the active part of the oscillator in the jig AND it has the specified load capacitance. The crystal is then ground until it operates within the desired tolerance at the desired frequency. Thus, 7pf crystals are ground very slightly differently than, lets say, 15pf crystals. Other than that, they will appear identical. It IS possible that Q (and, hence, loss) may be slightly different since one version has a slightly different amount of quartz than the other. But, I suspect, that there may be that much variation from device to device with the same load capacitance spec. 

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As a practical matter, also, one has to consider the capacitance of the traces on the PCB from the micro's leads, to the Xtal, and to the Xtal caps.

 

I've never measured that capacitance, as it just hasn't mattered for my projects.

Additionally, I don't have any instruments that I would trust to make that measurement and be within +/- a few nF, (much less pF !!!).

(And even then, at what operating conditions does one actually make that measurement?)

 

So, I'd suggest that a few pf difference in the Xtal's spec just isn't going to matter, and unless you are buying rather expensive caps, I bet their tolerance is actually pretty wide, anyways.

 

Of greater consideration, IMHO, is the hardware design consideration App Notes that discuss that the traces to the Xtal should be as short as possible, and symmetric, and that one should pay very close attention to the Ground return path for the Xtal's caps, and that one should put a separate ground plane under the Xtal and its caps.

 

I don't do production apps, but I'll just mention that most of my projects violate many of those optimal design consideration suggestions...

 

JC  

 

Edit: Typo

 

Last Edited: Thu. Feb 1, 2018 - 06:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I usually figure about 5pf for traces NOT over a ground-plane. This includes pin-pin capacitance of a DIP package. Its a bit less for pinned SMT packages and even a bit less than that for leadless packages. Its a bit more over a ground plane.

 

The consequence of NOT including trace capacitance in your figuring of capacitor values is that your oscillator will run slightly slow. Typically this frequency error will push the frequency to around the lower limit of the spec'd tolerance for the crystal. For most MCU applications, this is invisible, since it is often in the range of 100ppm.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

I usually figure about 5pf for traces NOT over a ground-plane. This includes pin-pin capacitance of a DIP package. Its a bit less for pinned SMT packages and even a bit less than that for leadless packages. Its a bit more over a ground plane.

 

The consequence of NOT including trace capacitance in your figuring of capacitor values is that your oscillator will run slightly slow. Typically this frequency error will push the frequency to around the lower limit of the spec'd tolerance for the crystal. For most MCU applications, this is invisible, since it is often in the range of 100ppm.

 

That much?  Wow.  I anticipate using a ground plane under everything, but SMT package.  So should I really be factoring this into the capacitor calculations?  If the crystal calls for 20pF capacitors, should I be using 15pF instead? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just to put this into perspective...

 

Suppose that it does raise the frequency by 100ppm (from being too low by 100ppm).  1ppm is equivalent to 1 Hz per MHz of frequency. Thus, for a 10MHz crystal, we might expect a shift in the actual crystal operating frequency somewhere around 1KHz. For an 8MHz crystal, it would be closer to 800Hz.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you wanna make yourself go crasy.

The magic word is: AD-M001251

https://duckduckgo.com/html?q=AD...

It's a 300 page pdf with more info about quarts crystals than you would ever want to know.

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Paulvdh wrote:
The magic word is: AD-M001251 https://duckduckgo.com/html?q=AD...

Thanks!!!

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I put 18pF on my crystals mostly because I have a big box of 18pF caps, but never had a problem with them.  I'm also not doing super-duper-high-precision timing work.  YMMV.  S.