| Author |
Message |
Pooh Bear
Guest
|
Posted:
Tue Feb 08, 2005 8:41 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
John Larkin wrote:
| Quote: | On Tue, 08 Feb 2005 01:23:15 GMT, "Chris Graham" <chrisgr@shaw.ca
wrote:
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.
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.
|
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
|
|
| Back to top |
|
 |
Anthony Fremont
Guest
|
Posted:
Tue Feb 08, 2005 5:17 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
"Rich Grise" <richgrise@example.net> wrote in message
| Quote: | Well, according to the data sheet,
http://www.atmel.com/dyn/resources/prod_documents/doc2486.pdf
it's just the standard uP crystal hook-up. If you take a crystal like
the Digi-Key 535-9103-1-ND, under "ABM3 Series 5.0 x 3.2 SMD
Crystals",
http://dkc3.digikey.com/PDF/T051/0747-0748.pdf
you'l lsee that the recommended load capacitance is 18 pF. This is the
series combination of the two caps in the Atmel data sheet, so they'd
be
36 pf, but 33 pf each should be close enough.
Should I bill you by paypal for my consulting fee? ;-)
|
Not until you remember to include the 5pF of pin capacitance. ;-)
Seriously though, IMO the crystal manufacturer knows more about what
caps to use than the datasheet does. The goal is to get the thing to
start reliably and to oscillate within specs. Only the crystal
manufacturer knows how they ground the crystal. Isn't anyone going to
mention series vs. parallel? (:-) |
|
| Back to top |
|
 |
Spehro Pefhany
Guest
|
Posted:
Tue Feb 08, 2005 5:33 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Tue, 08 Feb 2005 11:17:13 GMT, the renowned "Anthony Fremont"
<spam@anywhere.com> wrote:
| Quote: | Seriously though, IMO the crystal manufacturer knows more about what
caps to use than the datasheet does. The goal is to get the thing to
start reliably and to oscillate within specs.
|
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
|
|
| Back to top |
|
 |
Anders F
Guest
|
Posted:
Tue Feb 08, 2005 5:50 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
"Rich Grise" <richgrise@example.net> wrote in message
news:pan.2005.02.08.05.09.03.310144@example.net...
| Quote: | On Tue, 08 Feb 2005 02:43:14 +0000, Chris Graham wrote:
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?
Pick a crystal you like for freq. and package. The data sheet gives a load
capacitance. Use two capacitors the way they have them in the data sheet;
one on each side of the crystal, with the other ends of both caps
grounded.
The _series_ combination of those two caps should equal that load
capacitance from the crystal spec.
|
Actually pin/package capacitance of the microcontroller should be counted in
as well. Some micros (MSP430 ie.) even has enough load for low cap xtals...
However this is not a current Atmel feature.
| Quote: | For example, if the crystal load
capacitance is 18 pF, two 36 pF caps in series give that result. 33 pF is
the closest common value, and that'll be close enough.
Ordinary ceramics
are fine; I think in that size range the stable ones aren't that much more
expensive.
Good Luck!
|
Not that he'll need it of course ;-)
/A
|
|
| Back to top |
|
 |
Anders F
Guest
|
Posted:
Tue Feb 08, 2005 5:53 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
"Pooh Bear" <rabbitsfriendsandrelations@hotmail.com> wrote in message
news:420865BA.501D5C6@hotmail.com...
| Quote: | Dave VanHorn wrote:
Also, how would I determine the capacitors to use with the crystal?
---
Look in the µC data sheet
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.
You mean most of the crystals they sell aren't designed to work in the uC
manufacturers' app circuits ?
|
They are. But Dave is right: The needed capacitance should come from the
xtal datasheet....
| Quote: | I suggest you re-think.
What's wrong with a resonator btw ( low cost applications )
|
Precision over temperature for UART applications?
/A
|
|
| Back to top |
|
 |
Anders F
Guest
|
Posted:
Tue Feb 08, 2005 6:03 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
"Pooh Bear" <rabbitsfriendsandrelations@hotmail.com> wrote in message
news:4208682A.FC26ED61@hotmail.com...
| Quote: |
John Larkin wrote:
On Tue, 08 Feb 2005 01:23:15 GMT, "Chris Graham" <chrisgr@shaw.ca
wrote:
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.
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.
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' !
|
"Stop agonising - stick some bloody caps in there and see it oscillate ! The
value is *non-critical* +/- about nearly 50%"
I guess the +/50% doesn't quite hold then? I haven't had big production of
uCs yet - but oscillator problems are the worst, and I can follow Chris in
wanting it right the first time!
| Quote: | 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 !
|
That sucks! I'd be furios... Design changes should not be introduced without
verification and updating documentation. Guess they didn't read the ISO
qualification ;-)
Cheers,
Anders
|
|
| Back to top |
|
 |
Chris Graham
Guest
|
Posted:
Tue Feb 08, 2005 7:31 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
"Pooh Bear" <rabbitsfriendsandrelations@hotmail.com> wrote in message
news:42086501.AABD8343@hotmail.com...
| Quote: |
Chris Graham wrote:
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.
Atmels' data sheets are a model of clarity.
|
Precisely my point when I said that other microcontrollers data were less
informative, and why I was asking these questions, to gain a broader
understanding.
| Quote: |
If you are incapable of reading one and finding the answer, I suggest a
new
career in manageemnt where your skills will be appreciated.
|
Please refer to the ATMEGA8 spec and give me the page number(s) where it
answered ALL, or even ANY of SPECIFIC the questions I asked.
I've been building microcontroller circuits for quite some time, and they
all work. However, my specific field is software, where I won a number of
awards, made millions of dollars, and (semi) retired in my 40's.
I'm now experimenting with electronic music controllers. Hence my questions
on specific electronic details, in which I tried to be as clear as possible
about what I did and didn't understand, which others kindly and
intelligently answered.
Thank you all who gave helpful answers! |
|
| Back to top |
|
 |
Bob Stephens
Guest
|
Posted:
Tue Feb 08, 2005 8:35 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Tue, 8 Feb 2005 12:53:39 +0100, Anders F wrote:
| Quote: | What's wrong with a resonator btw ( low cost applications )
Precision over temperature for UART applications?
|
Bingo. |
|
| Back to top |
|
 |
Christopher Graham
Guest
|
Posted:
Tue Feb 08, 2005 8:43 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
| Quote: | What's wrong with a resonator btw ( low cost applications )
Precision over temperature for UART applications?
It's for a node on a 1 mbps RS485 network, so clock precision is important. |
|
|
| Back to top |
|
 |
Spehro Pefhany
Guest
|
Posted:
Tue Feb 08, 2005 9:24 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Tue, 08 Feb 2005 14:35:23 GMT, the renowned Bob Stephens
<stephensyomamadigital@earthlink.net> wrote:
| Quote: | On Tue, 8 Feb 2005 12:53:39 +0100, Anders F wrote:
What's wrong with a resonator btw ( low cost applications )
Precision over temperature for UART applications?
Bingo.
|
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 |
|
| Back to top |
|
 |
John Fields
Guest
|
Posted:
Tue Feb 08, 2005 9:24 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Tue, 08 Feb 2005 14:43:23 GMT, "Christopher Graham"
<chrisgr@shaw.ca> wrote:
| Quote: |
What's wrong with a resonator btw ( low cost applications )
Precision over temperature for UART applications?
It's for a node on a 1 mbps RS485 network, so clock precision is important.
|
---
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 |
|
| Back to top |
|
 |
Tim Wescott
Guest
|
Posted:
Tue Feb 08, 2005 9:37 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
Pooh Bear wrote:
| Quote: | John Larkin wrote:
On Tue, 08 Feb 2005 01:23:15 GMT, "Chris Graham" <chrisgr@shaw.ca
wrote:
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.
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.
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
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 |
|
| Back to top |
|
 |
Fred Bloggs
Guest
|
Posted:
Tue Feb 08, 2005 9:40 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
Chris Graham wrote:
| Quote: |
However, my specific field is software, where I won a number of
awards, made millions of dollars, and (semi) retired in my 40's.
|
Are you that "Ian Bell" thing? |
|
| Back to top |
|
 |
Chris Graham
Guest
|
Posted:
Tue Feb 08, 2005 10:04 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
Fred Bloggs wrote:
| Quote: | Are you that "Ian Bell" thing?
|
Something like that. Actually I was design lead and software architect for
Microsoft Excel.
This current project is to develop a network to carry the Open Sound Control
protocol to connect inexpensive and tiny sensor nodes for integrating into
custom electronic musical instruments. |
|
| Back to top |
|
 |
Dave VanHorn
Guest
|
Posted:
Tue Feb 08, 2005 10:13 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
| Quote: | Seriously though, IMO the crystal manufacturer knows more about what
caps to use than the datasheet does. The goal is to get the thing to
start reliably and to oscillate within specs. Only the crystal
manufacturer knows how they ground the crystal. Isn't anyone going to
mention series vs. parallel? (:-)
|
I'm always amazed at the number of people who think this is so damned
difficult to pick two caps, that you should buy a canned oscillator..
The crystal will probably "run" with any reasonable value of cap, somewhere
close to it's loading spec. Indeed, most people seem to pick caps that are
about half what they should be, yet they still "run".
In order to do it right though, you need to estimate your parasitics,
(5pF-ish?) then double the loading spec, and subtract the parasitics.
Populate with that, and check oscillation. I use a good shortwave receiver,
as it does not load the circuit at all. Of course you can do a timing loop
and attach a freq counter there, or whatever else works for the equipment
you have.
Of course nobody would use a series crystal in a parallel circuit, you'd
never be able to get it to sing the right tune! :)
There is a stability check that you should make, so on your protos, add a
resistor between the osc out pin and the crystal, so you can make the test
easily. In production you can zero it, or remove it entirely, as long as you
don't overdrive the crystal. |
|
| Back to top |
|
 |
|
|
|
|