Author Topic: Crystal ppm and timing accuracy  (Read 1624 times)

0 Members and 1 Guest are viewing this topic.

Offline mercurialTopic starter

  • Contributor
  • Posts: 49
  • Country: gb
Crystal ppm and timing accuracy
« on: April 01, 2024, 08:38:23 am »
I see that typical crystal for MCU are +/- 20 to +/- 50 ppm.

So if the crystal is 20Mhz and the MCU pll's internally are multiplying it to 100Mhz and If I measure a time of 1second with this 100Mhz clock.

Would it be safe to say that for 1 second I would get an error of 100 * 20ppm = +/- 2000 clock cycles.

For 100Mhz  a clock cycle is 10ns so you would get an error of 20000ns or 20us.
Are there any means to mitigate this, I've heard of OCXO and TCXO but just wondering how does one get a more precise timings from a crystal.
 

Offline Andy Chee

  • Frequent Contributor
  • **
  • Posts: 691
  • Country: au
Re: Crystal ppm and timing accuracy
« Reply #1 on: April 01, 2024, 09:16:55 am »
What is your application? This will dictate what potential solutions are available.

As a simple hardware solution, a poor man’s OCXO can be made by gluing a PTC thermistor to the metal case of the crystal, and  cable tying some scrap polystyrene packaging material around it.

https://youtube.com/watch?v=KxVJfxiw4ZQ

A software solution would require the uC to measure its own time offset relative to a known standard (or relative to manual time setting).  From this it can calculate the crystal’s drift and automatically correct it.

One second pulses are available from GPSDO but this may not be suitable, depending on your application.
 
The following users thanked this post: mercurial

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1555
  • Country: au
Re: Crystal ppm and timing accuracy
« Reply #2 on: April 01, 2024, 09:28:47 am »
.., I've heard of OCXO and TCXO but just wondering how does one get a more precise timings from a crystal.
Pay more money 😎
You can calibrate out fixed offsets, which can be significant in MCU systems.
That leaves the temperature curve and aging.
If your MCU can read temperature you can also do a multi point calibrate, and do a primitive tcxo.
Or you might decide buying a high volume tcxo, to replace the crystal, like GPS 26MHz ones is a better solution.
It all depends on how much precision you actually need.
 
The following users thanked this post: mercurial

Offline mercurialTopic starter

  • Contributor
  • Posts: 49
  • Country: gb
Re: Crystal ppm and timing accuracy
« Reply #3 on: April 01, 2024, 09:47:20 am »
Hi
What kind's of ppm does OCXO and TCXO achieve.
I don't have any application in mind, its just that it suddenly struck me that crystals could have as much error, a topic which I had not reflected upon till now.

I see that crystals have 2 ratings
a. tolerance (given in ppm)
b. stability (given in ppm)

I guess the software calibration evens out the tolerance part and the temperature sensor takes care of the stability.
Is that right?
 

Offline Picuino

  • Frequent Contributor
  • **
  • Posts: 732
  • Country: 00
    • Picuino web
Re: Crystal ppm and timing accuracy
« Reply #4 on: April 01, 2024, 10:07:17 am »
Approximately these are the accuracy ranges:

XTAL  10 ppm
TCXO   1ppm
OCXO   0.01ppm
Rubidium  0.0001 ppm

Edit:
Accuracy vs precision: https://www.forecast.app/blog/difference-between-accuracy-precision
« Last Edit: April 01, 2024, 10:09:09 am by Picuino »
 
The following users thanked this post: mercurial

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1555
  • Country: au
Re: Crystal ppm and timing accuracy
« Reply #5 on: April 01, 2024, 06:55:43 pm »
I guess the software calibration evens out the tolerance part and the temperature sensor takes care of the stability.
Is that right?
Essentially, yes.

There is also aging in ppm/year (1-3ppm/yr common).

Without paying too much premium you can often get 10 ppm tolerance, but those need careful loading C to centre that ( or you can centre it in sw )
Another number, less common on data sheets, is pullability, in ppm/pF which shows how precise you need to match total physical C for factory precision.
 
The following users thanked this post: mercurial

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 3701
  • Country: gb
  • Doing electronics since the 1960s...
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: Siwastaja, mercurial

Offline kevin.gibbs

  • Contributor
  • Posts: 34
  • Country: us
    • Teardown it!
Re: Crystal ppm and timing accuracy
« Reply #7 on: April 10, 2024, 01:16:44 pm »
You can use TCXO generators to improve accuracy. The generators will reduce temperature instability. The frequency will be more stable but may not be accurate enough. Due to the aging of the quartz, the frequency will change over time. You can adjust the frequency by changing the voltage on one of the pins. Under favorable conditions (small temperature variation, stable power supply, and constant load), you can achieve an accuracy of 0.1PPM or better. As an example: TG5032CFN https://support.epson.biz/td/api/doc_check.php?dl=app_TG5032CFN&lang=en
Teardown, research, create!
 

Offline Zenith

  • Frequent Contributor
  • **
  • Posts: 478
  • Country: england
Re: Crystal ppm and timing accuracy
« Reply #8 on: April 10, 2024, 10:35:14 pm »
It's a thing you consider in design and for most applications, +/- 50 ppm is more than enough. There's rarely if ever an attempt to tweak the crystal frequency with a preset capacitor. Who cares if a washing machine's final spin nominally set to 180 seconds, takes 178 seconds or 182 seconds? A cheap crystal would be well within that anyway. Cost may be a factor and you can cheap out by using a ceramic resonator, or the RC oscillator option some µcontrollers have, which have looser tolerances than a cheap crystal or crystal oscillator unit.

As I recall you can buy crystals with +/- 10ppm tolerance or there are 32 kHz watch crystals which have close tolerances.

There are tricks such as using a feedback mechanism to keep a crystal oscillating at a very low amplitude, which help with stability but basically if you have something such as a digital AWG, if a tweakable crystal won't do, you have to pay for a TCXO or an OCXO, or a double overnised OCXO, or there are better and more expensive frequency reference options. Racal frequency counters came with several frequency reference options, a TXCO, an OCXO, a superior OCXO, and an adjustable basic crystal oscillator, only good for a couple of ppm, which was aimed at customers who intended to use an external frequency reference.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf