Choosing a Crystal for a Microcontroller

Unless it's for volume production and cost is critical, just use a surface-mount oscillator. You can have a lot of trouble with uP on-board oscillator circuit.

John

Reply to
John Larkin
Loading thread data ...

--
Look in the µC data sheet
Reply to
John Fields

Arrgghh.. The crystal manufacturers would disagree. The caps are selected, in order to load the crystal to it's design value, taking into account the parasitics in the circuit.

Reply to
Dave VanHorn

I'm not clear on what the considerations are for choosing a crystal. I've looked at electronics reference books and web sites but can't find a clear answer. I know which microcontroller I want to use (in this case an ATMEGA8). I also know the frequency (16 mhz).

How would I select a compatible crystal based on factors like the load capacitance and ESR (equivalent series resistance)?

I this case I need to select the smallest surface mount crystal that will work. Maybe a Citizen CS10?

Also, how would I determine the capacitors to use with the crystal?

Thanks.

Reply to
Chris Graham

See page 25 of the data sheet.

Leon

--
Leon Heller, G1HSM
http://www.geocities.com/leon_heller
Reply to
Leon Heller

Don't be such a smartass. These answers aren't very helpful.

I did look in the Atmel data sheet. It gives a range of capacitor values for each frequency. It doesn't mention the crystal "load capacitance" or ESR.

When I look at Digikey's offerings I see that crystals are available with load capacitances from 5pf to 50pf. Does it make any difference? If not, why is it specified for crystals? The data sheet also doesn't mention ESR. I've seen some data sheets that don't even suggest any capacitor values.

Can I just pick any crystal and be assured that it will oscillate with the approproate capacitors, which I should choose by trial and error?

I can also see on DigiKey that there are "series" type crystals. Is there any difference between these and other crystals?

Reply to
Chris Graham

Thanks Leon. I've been looking at page 25. Does this mean that ANY crystal with any load capacitance will work as long as I use capactiors with those values?

I see some crystals are even offered with more than one choice of load capacitance, so would it matter if I choose one with say a 18pf capacitance vs say a 25pf capacitance?

Reply to
Chris Graham

And not drift or fail prematurely from being overdriven.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

After some not very good experiences with the PIC and crystals I shifted to using either a 3-legged ceramic resonator, or a dil crystal oscillator.

--
Tony Williams.
Reply to
Tony Williams

How may times have we seen this question ?

*Read the damn data sheet for God's sake !*

Normally the uC manufacturer suggests a value for both Cs. Unusually that may be be required to be changed to suit an unusual crystal. Try around 20 - 30 pF. That's usually fine for 16MHz. I use 33 pF for an 80C52 based design @ 16 MHz.

Graham

Reply to
Pooh Bear

Atmels' data sheets are a model of clarity.

If you are incapable of reading one and finding the answer, I suggest a new career in manageemnt where your skills will be appreciated.

Graham

Reply to
Pooh Bear

You mean most of the crystals they sell aren't designed to work in the uC manufacturers' app circuits ?

I suggest you re-think.

What's wrong with a resonator btw ( low cost applications )

Graham

Reply to
Pooh Bear

Stop agonising - stick some bloody caps in there and see it oscillate ! The value is *non-critical* +/- about nearly 50%

It's *not* rocket science !

Graham

Reply to
Pooh Bear

Really ?

Would you mind elaborating on that please ?

Low cost uCs even have internal RC oscillators that can be programmed via the SFRs ( special function registers ) to avoid the need for an external oscillator source to avoid the cost of *even* a resonator - never mind a crystal these days. Saves a few pins for I/O too btw !

I've *never* had a problem with an uC oscillator circuit except when my so-called *colleagues* decided not to introduce a 33pF cap into stores and substituted a 22pF cap instead. It worked fine for about 3 yrs until we got a batch of 'fussy' crystals' !

Oh - how we laughed ! At least I did - at their infantile stupidity. Some ppl are too lazy even to introduce a new component - the schematic had the

*correct* value though despite another being fitted !

LMAO !

Graham

Reply to
Pooh Bear

If you have a $500 000 product that can't be shipped because a $1000 board used a $0.25 crystal instead of a $4 oscillator then this could be a very big deal.

For volume production, and/or a product where the electronics are most of the value, using a crystal and not an oscillator is probably appropriate. It depends on:

  • How likely the oscillator will fail using a crystal,
  • how likely the oscillator will fail using a packaged oscillator,
  • how much extra it costs per board for the packaged oscillator,
  • how much it costs for man-hours to fix the crystal oscillator,
  • how much the line down-time costs,
  • how many units you're making.
--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Reply to
Tim Wescott

Well, since you asked so politely...

When you buy an oscillator, it most always oscillates. The mfr makes the quartz and the circuit and builds millions of them.

When you hang a crystal and a couple of caps on a uC, you have, generally, a mediocre oscillator circuit that may or may not be happy with the crystal parasitic C and series R, and you may or may not have the right caps for the situation. If you really know and understand all the params, and have the time for serious loop analysis, you can get it right. If not, you can have all sorts of interesting problems when the breadboard hits production, and to get stable oscillation you may wind up spending a great deal of time and pushing the xtal 50 PPM in the wrong direction or something. And TC is anybody's guess.

I don't advocate buying an oscillator if the uP already has one inside. Unless you care about accuracy.

Crystals can be fussy; that's the point.

Great fun, having stupid infants as co-workers. If your company went under, I bet that would be even funnier.

I don't have your sense of humor. I like my employees and want everything to work.

John

Reply to
John Larkin

Namely what worked for them with the crystal they bought somewhere. They probably had an intern figure this out, as all the interesting problems are digital.

After the first couple hundred units in the field refuse to start up when it's cold.

Try various caps and crystals til you find a combination that works. Then build a few thousand to see if it's reliable.

John

Reply to
John Larkin

Seems to me you have presented some great arguments for buying a complete oscillator for about 50 cents more.

John

Reply to
John Larkin

--- Since the requirements for the oscillator seem to be tightening up, you'd probably be well advised to take John Larkin's advice and get yourself a packaged oscillator which will give you the accuracy you want right off the bat. Spec it, solder it in, and you're good to go. Otherwise you're going to wind up with a bucket of worms having to worry about the accuracy and tempco of the crystal, the tolerances and tempcos of the loading caps,(one of which may have to be a trimmer in order to get the frequency to be what you want it to be), the drive level into the crystal and on and on ...

-- John Fields

Reply to
John Fields

Typical specs are +/-0.5% initial tolerance +/-0.2% or 0.3% over temperature. What's the problem?

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.