| Author |
Message |
John Larkin
Guest
|
Posted:
Wed Feb 09, 2005 8:40 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Tue, 8 Feb 2005 23:36:05 -0500, "Dave VanHorn"
<dvanhorn@dvanhorn.org> wrote:
| Quote: |
Seems to me you have presented some great arguments for buying a
complete oscillator for about 50 cents more.
I sort of see your point, but the cost delta is much larger than that.
Crystals run about $0.25-ish to $0.49 in moderate quantities, less if you
shop around or order more.
In most of the designs I've done, adding $0.5 to the BOM is a serious
offense.
If you're making 1M of them, then you just spent a couple years salary.
|
But if you're making 1M of them, what would a 5% field failure rate
cost? It's fine to use a cheap crystal and a cap or two, as long as
you thoroughly analyze the gain and phase margins, drive level, and
startup dynamics, and you have a good enough relationship with the
crystal manufacturer to control motional parameters. Most people
posting here don't sound like they're doing it; they mostly suggest
fiddling with a prototype until it oscillates. "Try 33 pF" is scairy.
John
|
|
| Back to top |
|
 |
Rich Grise
Guest
|
Posted:
Wed Feb 09, 2005 8:40 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Tue, 08 Feb 2005 23:43:25 -0500, Dave VanHorn wrote:
| Quote: |
The caps perform two functions:
1. Get the crystal to its spec'd resonant frequency
2. Generate the right gain and phase shift around the loop to
guarantee reliable startup and oscillation.
Helmholtz must be satisfied.. :)
3: Swamp out the parasitics so that the part you don't control very well,
isn't the dominant factor.
My biggest beef with Atmel at this point, is that they don't charachterize
the Vittoz mode operation at all, and yet it's far more picky than the
normal rail-rail mode. (CKOPT fuse on M128-ish parts)
|
That's because it's an analog circuit, and they're digital weenies. And
they have so little confidence in their analog design skills, that they
just pick a number out of the air that they're fairly sure will work
enough more times than not that nobody will complain.
I've given the answer twice already.
The crystal's load capacitance should be 13 pf, Digi-key has them. The
capacitors should be 22 pf - Atmel says this in the chart at the bottom of
page 25 or 26.
Cheers!
Rich |
|
| Back to top |
|
 |
Dave VanHorn
Guest
|
Posted:
Wed Feb 09, 2005 8:40 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
| Quote: | With CKOPT low, the Xtal2 output "has a smaller output swing. This reduces
power consumption considerably. This mode has a limited frequency
range..."
|
This is the Vittoz mode. Be very very careful here, it's critical.
I'm still looking for my notes on this, I just moved, and things are a bit
disorganized.
Here's an app note from ECS, that describes the "negative resistance" test,
and pretty much covers everything except the Vittoz oscillators.
| Quote: | I guess that's spelled out in the chart. I'm ass-u-me-ing that "limited
frequency range" means "greater than 1 MHz", since the other ones go down
to 400 KHz. They say 5 pf of parasitics, so that'd be 27. 27 || 27 = 13.5,
so try to find a crystal with a load capacitance of 13.5. ;-)
Here ya go: Digi-key CTX646CT-ND or CTX 646TR-ND on Tape and Reel. ;-)
http://dkc3.digikey.com/PDF/T051/0768.pdf
Do I get a piece of the action? ;-P
Good Luck!
Rich
|
|
|
| Back to top |
|
 |
Dave VanHorn
Guest
|
Posted:
Wed Feb 09, 2005 8:40 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
| Quote: | But, the facts are, Atmel's data sheet doesn't mention crystal load
capacitance or ESR, and it does give a range of capacitor values for each
frequency.
|
They used to be better about that. They told you to find that out from the
crystal maker.
But apparently everyone wants the uP vendor to tell them what caps to use.
Lunacy....
Might as well ask the transistor maker what caps to use in your oscillator.
Without telling them what the inductor is, or where you'd like it to run. :)
| Quote: | You can't really fault a programmer for not having experience in
electronics components.
|
Most are somewhat trainable though! |
|
| Back to top |
|
 |
Dave VanHorn
Guest
|
Posted:
Wed Feb 09, 2005 8:40 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
| Quote: | The caps perform two functions:
1. Get the crystal to its spec'd resonant frequency
2. Generate the right gain and phase shift around the loop to
guarantee reliable startup and oscillation.
|
Helmholtz must be satisfied.. :)
3: Swamp out the parasitics so that the part you don't control very well,
isn't the dominant factor.
My biggest beef with Atmel at this point, is that they don't charachterize
the Vittoz mode operation at all, and yet it's far more picky than the
normal rail-rail mode. (CKOPT fuse on M128-ish parts) |
|
| Back to top |
|
 |
Rich Grise
Guest
|
Posted:
Wed Feb 09, 2005 8:40 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Tue, 08 Feb 2005 23:40:17 -0500, Dave VanHorn wrote:
| Quote: |
But, the facts are, Atmel's data sheet doesn't mention crystal load
capacitance or ESR, and it does give a range of capacitor values for each
frequency.
They used to be better about that. They told you to find that out from the
crystal maker.
But apparently everyone wants the uP vendor to tell them what caps to use.
Lunacy....
Might as well ask the transistor maker what caps to use in your oscillator.
Without telling them what the inductor is, or where you'd like it to run. :)
You can't really fault a programmer for not having experience in
electronics components.
Most are somewhat trainable though!
|
Me, too. Turns out that the Atmel data sheet gets right down to the
nitty-gritty, and says, "12-22 pF".
But you have to have the perseverance to read it, even though it reads
like Aylward, and the experience to understand it.
So give the poor retired Microsoft programmer a break. ;-)
Cheers!
Rich |
|
| Back to top |
|
 |
Dave VanHorn
Guest
|
Posted:
Wed Feb 09, 2005 8:40 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
| Quote: | Seems to me you have presented some great arguments for buying a
complete oscillator for about 50 cents more.
|
I sort of see your point, but the cost delta is much larger than that.
Crystals run about $0.25-ish to $0.49 in moderate quantities, less if you
shop around or order more.
In most of the designs I've done, adding $0.5 to the BOM is a serious
offense.
If you're making 1M of them, then you just spent a couple years salary. |
|
| Back to top |
|
 |
Pooh Bear
Guest
|
Posted:
Wed Feb 09, 2005 8:40 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
John Fields wrote:
| Quote: | On Tue, 08 Feb 2005 14:43:23 GMT, "Christopher Graham"
chrisgr@shaw.ca> wrote:
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 ...
|
Makes you wonder how those cheap asian network cards we all use ever work !!!!
Sounds like an awful lot of worry over nothing ! I'm sure the asians don't lose
any sleep over such things.
Graham |
|
| Back to top |
|
 |
John Larkin
Guest
|
Posted:
Wed Feb 09, 2005 8:41 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Wed, 09 Feb 2005 01:51:20 GMT, Rich Grise <richgrise@example.net>
wrote:
| Quote: | Well, there it is. Recommended range for caps is 12-22 pF. So use 2X 22 pf
and you're done. I guess "1.0 <=" means "1 is less or equal to [frequency]".
With CKOPT low, the Xtal2 output "has a smaller output swing. This reduces
power consumption considerably. This mode has a limited frequency range..."
|
Red flag. Translate as "this mode doesn't always work."
John |
|
| Back to top |
|
 |
John Larkin
Guest
|
Posted:
Wed Feb 09, 2005 8:41 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Wed, 09 Feb 2005 14:46:32 +1300, Terry Given <my_name@ieee.org>
wrote:
| Quote: |
Try various caps and crystals til you find a combination that works.
Then build a few thousand to see if it's reliable.
John
Freeze spray is your friend, along with a heat gun. Messing with the
micro power supply can be useful too - Vmin to Vmax. A few years ago we
had a whole bunch of Rabbit RCM2200 ethernet modules that killed their
crystals by overdriving them - worked fine for a few months, then
crystals failed completely (its very hard to run ethernet without a
clock). I spent a few hours trying to kick-start them (many different
c's, T etc) to no avail. An analysis of the circuit soon showed the
crystal drive levels were very high, and although a series R was present
the manufacturer used an 0R0 link. 1k was a *MUCH* better choice (IIRC).
I talked to Rabbit, and they acknowledged the design fault, since
rectified (I wasnt the only customer to find this).
|
A series R adds (sometimes) valuable phase shift.
| Quote: | To be fair it can be quite tricky to work out what drive level the
crystal can take, as manufacturers can be loath to part with this info.
|
Horror stories like this are legion. Unless there's volume with huge
cost pressure, it's safer to buy a canned oscillator. If there is
volume with huge cost pressure, you can't afford to not do a thorough
analysis and absolutely maintain control of the crystal motional
parameters.
The funnest case is oscillators that won't start. That can be
sensitive to temperature, emi, mounting (is the can *really* grounded,
or just sometimes?) or power supply startup dV/dT.
John |
|
| Back to top |
|
 |
Anders F
Guest
|
Posted:
Wed Feb 09, 2005 4:53 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
"Rich Grise" <richgrise@example.net> wrote in message
news:pan.2005.02.09.01.01.39.633151@example.net...
| Quote: | On Tue, 08 Feb 2005 12:50:38 +0100, Anders F wrote:
"Rich Grise" <richgrise@example.net> wrote in message
news:pan.2005.02.08.05.09.03.310144@example.net...
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.
Actually, I thought of this an ohnosecond after sending, and rationalized,
"ah, heck - 33 instead of 36 takes out 3 pf of strays each, right?" ;-)
|
I knew you did! =)
And I agree that it's small figure in the mentioned case - however for low
load xtals I figure it might be siginifcant. For sure it is with the MSP430
that can load 6pF watch crystals...
| 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 ;-)
Well, I don't know. He's admitted he's been touched by the Shadows - we
might have to kill him just on GPs. ;-)
|
GPs? (If its bad I'll throw the first 0201 cap at him ;-)
Cheers,
Anders
|
|
| Back to top |
|
 |
Anders F
Guest
|
Posted:
Wed Feb 09, 2005 4:58 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
"Spehro Pefhany" <speffSNIP@interlogDOTyou.knowwhat> wrote in message
news:q4mh015kgcnaue5sjfcc30n4k287f54kh2@4ax.com...
| Quote: | On Tue, 08 Feb 2005 14:35:23 GMT, the renowned Bob Stephens
stephensyomamadigital@earthlink.net> wrote:
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?
|
That sounds resonable. Maybe I should consider them. At least they MUST be
smaller than my current HCU49 xtals...
Any other dirt one should consider? Are they available in UART friendly
frequencies around 4MHz? Problems with startup? Other?
Cheers,
Anders
|
|
| Back to top |
|
 |
Spehro Pefhany
Guest
|
Posted:
Wed Feb 09, 2005 6:28 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Wed, 9 Feb 2005 11:58:42 +0100, the renowned "Anders F"
<af-spam@hi5.dk> wrote:
| Quote: | "Spehro Pefhany" <speffSNIP@interlogDOTyou.knowwhat> wrote in message
news:q4mh015kgcnaue5sjfcc30n4k287f54kh2@4ax.com...
On Tue, 08 Feb 2005 14:35:23 GMT, the renowned Bob Stephens
stephensyomamadigital@earthlink.net> wrote:
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?
That sounds resonable. Maybe I should consider them. At least they MUST be
smaller than my current HCU49 xtals...
Any other dirt one should consider? Are they available in UART friendly
frequencies around 4MHz? Problems with startup? Other?
Cheers,
Anders
|
More reliable and faster startup, and thus excellent for low-power
applications where you shut down the main clock oscillator to save
power.
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 |
|
 |
Dave VanHorn
Guest
|
Posted:
Thu Feb 10, 2005 8:41 am Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
| Quote: | That's because it's an analog circuit, and they're digital weenies. And
they have so little confidence in their analog design skills, that they
just pick a number out of the air that they're fairly sure will work
enough more times than not that nobody will complain.
I've given the answer twice already.
The crystal's load capacitance should be 13 pf, Digi-key has them. The
capacitors should be 22 pf - Atmel says this in the chart at the bottom of
page 25 or 26.
|
It's not nearly that simple in the low power Vittoz mode.
Been there, done that, had the halted production line.
In the normal rail-rail mode, yes pretty much any parallel resonant AT cut
crystal will work. |
|
| Back to top |
|
 |
Rich Grise
Guest
|
Posted:
Sat Feb 12, 2005 1:15 pm Post subject:
Re: Choosing a Crystal for a Microcontroller |
|
|
On Wed, 09 Feb 2005 21:46:53 -0500, Dave VanHorn wrote:
| Quote: |
That's because it's an analog circuit, and they're digital weenies. And
they have so little confidence in their analog design skills, that they
just pick a number out of the air that they're fairly sure will work
enough more times than not that nobody will complain.
I've given the answer twice already.
The crystal's load capacitance should be 13 pf, Digi-key has them. The
capacitors should be 22 pf - Atmel says this in the chart at the bottom of
page 25 or 26.
It's not nearly that simple in the low power Vittoz mode.
Been there, done that, had the halted production line.
In the normal rail-rail mode, yes pretty much any parallel resonant AT cut
crystal will work.
|
So, then, does the chart at the bottom of that page only come into play
for unusual circuimstances?
In rail-to-rail mode, at 16 MHz, what are the recommended capacitors?
Atmel doesn't say, as OP has so eloquently noted.
Personally, I'd have opted for what I had said - is rail-to-rail mode
better? How? And Why? Do you then look for a different crystal? Like a
series crystal, and not bother with caps? Or use caps and a series crystal?
This has been going on for a week, and poor ol' OP still hasn't got a
reliable answer.
Thanks,
Rich |
|
| Back to top |
|
 |
|
|
|
|