Crystal ppm and timing accuracy - Page 1
Forum section: electronics / general

author: mercurial
author_rank: Regular Contributor
timestamp: April 01, 2024, 08:38:23 am
content: 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.

author: Andy Chee
author_rank: Super Contributor
timestamp: April 01, 2024, 09:16:55 am
content: 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=KxVJfxiw4ZQA 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.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: April 01, 2024, 09:28:47 am
content: Quote from: mercurial on April 01, 2024, 08:38:23 amPay 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.

author: mercurial
author_rank: Regular Contributor
timestamp: April 01, 2024, 09:47:20 am
content: HiWhat 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 ratingsa. 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?

author: Picuino
author_rank: Super Contributor
timestamp: April 01, 2024, 10:07:17 am
content: Approximately these are the accuracy ranges:XTAL 10 ppmTCXO 1ppmOCXO 0.01ppmRubidium 0.0001 ppmEdit:Accuracy vs precision:https://www.forecast.app/blog/difference-between-accuracy-precision

author: PCB.Wiz
author_rank: Super Contributor
timestamp: April 01, 2024, 06:55:43 pm
content: Quote from: mercurial on April 01, 2024, 09:47:20 amEssentially, 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.

author: peter-h
author_rank: Super Contributor
timestamp: April 02, 2024, 01:15:18 pm
content: Also see previous threads e.g.https://www.eevblog.com/forum/microcontrollers/cpu-crystal-pull-range-and-how-critical-are-the-caps-for-e-g-usb-fs/

author: kevin.gibbs
author_rank: Regular Contributor
timestamp: April 10, 2024, 01:16:44 pm
content: 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: TG5032CFNhttps://support.epson.biz/td/api/doc_check.php?dl=app_TG5032CFN&lang=en

author: Zenith
author_rank: Frequent Contributor
timestamp: April 10, 2024, 10:35:14 pm
content: 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.