Go Down

Topic: crystals for atmel chips (Read 3464 times) previous topic - next topic

krupski

(1) Admit it.  You, like I, came to Arduino with complete knowledge of microcomputers and even assembler.

(2) So why are we even interested in them if they are so far below our dignity?

Because they are a really neat modular system that you can use for rapid construction, just like the STAMP(, the PICAXE and its other spin-offs) - but more powerful, generally cheaper (vastly cheaper in terms of the clones) and not quite so dumbed down.

(3) As Mike would explain, there is a difference  between "working" and "working within specification".  Crystals have specified loading capacitance for correct, reliable and stable operation.  If you operate them outside of that specification, relying on the (significant) pin capacitance of the MCU chip, then it probably will work - but just don't expect it to work to specification.

(1) Yes indeed I had many years (several decades actually) of hardware and software design and fabrication experience, including Motorola and Intel assembler, and C/C++ programming (and even Basic!).

(2) An AVR attached to a breakout board is a rather handy and useful device. And, buying an Arduino board is cheaper and easier than building one from scratch.  But if I ever got off my behind and designed my own little breakout board, I would never use an Arduino board again.

(3) That's funny. A ceramic resonator is all over the place in frequency (mostly vs temperature) and that's just fine, yet a few PPM frequency error from an improperly loaded crystal is unacceptable.   :)
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

krupski

for example ive tested things like no caps and 16mhz at 3.3v over more than full temperature without problems but for military. medical, or space program etc would not dare such shortcuts.  however hobbyists do enjoy making believe the blinky is critical component in life support system.
Exactly. If I were designing something which was to be man-rated, you can bet your last cent that I would use the specified parts, from the specified manufacturer and specified lot number.

But, a blinking LED really isn't as important as a man-rated device...   :)
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

jboyton

(3) That's funny. A ceramic resonator is all over the place in frequency (mostly vs temperature) and that's just fine, yet a few PPM frequency error from an improperly loaded crystal is unacceptable.   :)
You're off by a couple orders of magnitude.

On the one hand you decry the sloppiness of the Arduino designs but at the same time leave out a couple of penny capacitors because it's just a "blinking LED".

I agree with you about crystals; I'd use one if I were designing my own Arduino-like board. Why not? But the truth is that a resonator is sufficient in most cases. Even the internal oscillator, which makes a resonator look like a rock, is often good enough.

john1993

#33
Sep 20, 2015, 09:05 pm Last Edit: Sep 20, 2015, 09:58 pm by john1993 Reason: correction: 7998 vs 8001 really is off by orders of magnitude
When I connect a crystal without capacitors to an Atmega328p it runs fast. Typical error is on the order of a few hundred parts per million.
edit: "really is off by a couple orders of magnitude."

at least that is what i see after testing several thousand m328 with and without caps for a customer over 2 year period.  i just ran another batch monday with similar results: average deviation around 300-400ppm.  ie hfuse=d0 lfuse=f7 22pf=7998.275mhz 0pf=8001.154mhz oc1a pin measured against gpsdo.  More for crystals for tcxo or ocxo which are designed for "pulling".  even then seems like about one order of magnitude off in my experience.  maybe extreme for ceramic too.

anyway as i said imo ceramic makes little sense. they really are more expensive than quartz on world market and yet significantly less accurate/stable.  if you need rtcc stability then common 16mhz are inadequate no matter what caps.  then temp compensated 32khz or tcxo etc are used.  may be good enough for things like async where just about anything works.  even properly calibrated internal ok for that.

only reason i can see for ceramic might be faster startup mentioned before with better accuracy than uncalibrated rc.  in other words one out of ten thousand applications.

jboyton

#34
Sep 20, 2015, 09:44 pm Last Edit: Sep 20, 2015, 09:50 pm by jboyton
at least that is what i see after testing several thousand m328 with and without caps for a customer over 2 year period.  i just ran another batch monday with similar results: average deviation around 30-40ppm not hundreds.  ie hfuse=d0 lfuse=f7 0pf=7998.275mhz 22pf=8001.154mhz oc1a pin measured against gpsdo.  i think you may have accidentally purchased crystals for tcxo or ocxo which are designed for "pulling".  even then seems like about one order of magnitude off in my experience.  maybe extreme for ceramic too.
I don't understand your numbers. 7998.275MHz isn't within a few parts per million. It's slow by 215ppm.

The ceramic resonators that I've measured, like those in my Unos, have been about 1000ppm slow.

My experience is much more limited than yours. I have only tested a handful of crystals and resonators. Maybe you can tell me if I purchased the wrong crystals. Here are two that I have tried recently:
http://www.mouser.com/Search/ProductDetail.aspx?R=9C-8.000MEEJ-Tvirtualkey57230000virtualkey717-9C-8.000MEEJ-T
http://www.mouser.com/Search/ProductDetail.aspx?R=ABL-16.000MHz-B1Uvirtualkey52750000virtualkey815-ABL-16-B1U

Also, our fuse settings are different. Yours are for full swing, slow rise and mine are for low power, fast rise. I wonder if that matters?

Still learning...

jboyton

#35
Sep 20, 2015, 09:48 pm Last Edit: Sep 20, 2015, 09:49 pm by jboyton
I see you edited your post. The 300-400ppm is in line with what I have seen in my few tests. That's two orders of magnitude, in terms of ppm error.

john1993

I see you edited your post. The 300-400ppm is in line with what I have seen in my few tests. That's two orders of magnitude, in terms of ppm error.
yes, that was a "senior moment". the measurements were correct but swapped and my ppm description off by some decimal points. corrected. maybe someday i will learn to count.  it really is off by orders of magnitude.

btw those were 2 cent hc49s from taobao. same seller puts then out on ebay for a nickel ea:  http://www.ebay.com/itm/121233096977?_trksid=p2055119.m1438.l2649&ssPageName=STRK%3AMEBIDX%3AIT (ebay almost always about 2x cost due to paypal and ebay fees). my statement quartz is cheaper was challenged offline so it would be interesting to see if ceramic can be had for anything close to that.

john1993

#37
Sep 21, 2015, 12:07 am Last Edit: Sep 21, 2015, 12:11 am by john1993 Reason: table
our fuse settings are different. Yours are for full swing, slow rise and mine are for low power, fast rise. I wonder if that matters?
some but apparently not that much compared to no caps.

its been a couple years since trying low power because savings did not strike me as worth the drawbacks but my interest was piqued so i tried the most common arduino settings:

Code: [Select]

h  l  22pf=      0pf=
da ff 7998.506 8001.847 promini
de ff 7998.505 8001.850 uno
d0 f7 7998.275 8001.154 mine

jboyton

Code: [Select]

h  l  22pf=      0pf=
da ff 7998.506 8001.847 promini
de ff 7998.505 8001.850 uno
d0 f7 7998.275 8001.154 mine

Thanks for doing that test. In the case of those crystals adding capacitors didn't improve the accuracy significantly. Was I just lucky with the $0.60 crystals I bought? Or is there something different about the specifications that matters?

I'm just a hobbyist and not in the least interested in savings of tens of cents. But if I were selling many boards I would care. At least from browsing digikey and mouser it appears that the really small SMD crystals are more expensive. Maybe that isn't the case in the general market, I don't know.


john1993

i find smd about twice the cost of hc49s: 5-10 cents depending on qty.  those cheapies my client buys and i piggyback are -12 so the 22pf numbers are close to expected.  however for various reasons 22pf is what my test jig is set up for.  what impresses me most is how amazingly close they all are.  with proper loading very little variation even from lot to lot.

but for real precision timekeeping like rtcc even a few ppm inadequate.  we must stay in the parts per billion to avoid having to correct time every few weeks so even quartz in the specified circuit not good enough.

jboyton

ithose cheapies my client buys and i piggyback are -12 so the 22pf numbers are close to expected.
-12 ppm? I didn't see anything like that in your examples.

...for real precision timekeeping like rtcc even a few ppm inadequate.
Adequate is a relative term. It's been largely missing from this discussion.

john1993

#41
Sep 21, 2015, 02:27 am Last Edit: Sep 21, 2015, 02:27 am by john1993
nono... "-12" means 12pf not ppm in the industry. used to be printed on the package for parallel cut but not so much these days.  to be honest not guaranteed for these alibaba cheapies.  i cannot afford to pay $2 for parts that i sell for $2 but 100% certification is worth it when they take less than one second to characterize.  shhhhhh.... ten thousand percent markup.

as far as relative terms it seems mentioning having to adjust every few weeks instead of months was indicative.  i would include lab grade freq counter in the "inadequate" class too.  the stock circuit not good enough for maybe half my commercial designs lately.  on the other hand did i mention no caps at all for most of my hobby projects?

jboyton

I just meant that adequate depends on the application. For the vast majority of Arduino users a ceramic resonator is adequate. So unless it can be demonstrated that replacing it with a crystal saves money or costs exactly same, why bother?

krupski

Also, our fuse settings are different. Yours are for full swing, slow rise and mine are for low power, fast rise. I wonder if that matters?

Still learning...

FYI, I also use full swing crystal and slow rise VCC fuse setting.

Interestingly though, there seems to be no difference between full swing and low power crystal. The amplitude of the crystal oscillation is the same between both settings as measured by oscilloscope, and also when received on a shortwave radio (same signal strength).
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

john1993

i see minor reduction in chip current and lower unloaded voltage.  you really need specialized probe to view that with a scope. 

the real difference is sensitivity to external noise and pcb layout which can be a big problem.  one infamous case was the m1284 fiasco where many believed defective ic but really was bad user design practices.  switching to full swing pretty much solved the problems.  i saw similar issues with at90s parts back in the old days.  low power mode is what i consider to be one of the poor choices made by team arduino.


artists... cant live with em... cant shoot em...  well you could but then we would have nothing to gripe about. :)

Go Up