help measuring RTC crystal - Page 1
Forum section: electronics / projects

author: nomar123
author_rank: Contributor
timestamp: December 29, 2021, 09:31:29 pm
content: I have a board that has an 32.768kHz RTC crystal with a +/- 25ppm specification.Since it is +/-25ppm that means my tolerance should be .0025%, which would come out to +/- .8192Hz as my tolerance (.000025*32768=.8192). This seems like an extremely tight tolerance, but for an RTC I would imagine you need it to be pretty tight. I just wasn't expecting it to be that tight.I want to verify that my crystal on board is within that tolerance. I used a low capacitance active probe to measure the crystal frequency and used the histogram function on my scope. The frequency with the maximum number of hits on the distribution was 32.736451kHz which is 2.549Hz off from the desired 32.768kHz target frequency.the crystal is the TC25L5I32K7680 and I am measuring from the output pin on the crystal to a nearby ground via. Very short ground loop and low C cause of the active probe.Would this deviation alarm you? Do you think I am making a measurement error? Since the tolerance is so tight and my measurement is only off by about 2.5hz I am hesitant to say something is wrong.

author: magic
author_rank: Super Contributor
timestamp: December 29, 2021, 09:42:04 pm
content: 1ppm is something like half a minute per year. 70ppm is half an hour. For accurate timekeeping you need those zeros after the decimalWhat's the timebase accuracy of your scope? I don't remember mine, but I do remember that it drifts measurably during warmup so I would be careful using it for ppm level stuff.I would try to make the board output a clock signal to avoid any doubt about loading the oscillator circuit in a way that won't occur in the field.

author: nomar123
author_rank: Contributor
timestamp: December 29, 2021, 09:52:45 pm
content: just looked at the manual and the timebase accuracy is ±1.0 x10-7. how would this affect the measurement?I didnt thing to calculate the actual PPm which would be about 76ppm, which is almost 40min/year! if that really is the drift that would not be good.I definitely want to make sure that I am not loading this down and getting a faulty measurement. I though the low C probe would do the trick but doesn't seem that way.Are you suggesting having a line of code spit out the RTC frequency on an unused GPIO? That makes sense to me, but is that the standard for testing an RTC crystal? I am wondering if I should abandon even trying to measure frequency directly on the crystal output.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: December 29, 2021, 09:56:36 pm
content: I don't know about trusting a scope for this, but your specs are good. It's where a real live frequency counter is usually better, but nobody seems to use those anymore. Loading is an issue. I've used an inductive pickup coil held near the traces. If the board puts out an actual time with seconds you could compare that to a broadcast time standard (WWV or WWVB) or GPS time (use a phone app like GPS Test) over a week or two.

author: bob91343
author_rank: Super Contributor
timestamp: December 30, 2021, 12:46:02 am
content: Let me add something here. First, the frequency of oscillation changes when you put the scope probe on. Second, the frequency depends upon many factors, especially the care with which the oscillator is designed.As the oscillator runs, the crystal temperature increases, however slightly, causing more drift. The ambient temperature is a major factor and each crystal is different.So the answer is that you have not measured the frequency properly. The temperature at which it is calibrated needs to be known, as well as the current through the crystal, the shunting impedance, and the phase angle between the crystal voltage and current that is demanded by the oscillator.None of these factors is easily determined. The best you can do is lightly load the crystal with a high impedance, and even find a circuit probe point that doesn't affect oscillation frequency much. Then measure the frequency with a precise counter that has been normalized to WWV or GOS, over a long period, say 10 or 100 seconds.

author: floobydust
author_rank: Super Contributor
timestamp: December 30, 2021, 01:22:37 am
content: OP, your part numberTC25L5I32K7680is an 3.3V oscillator module, not a crystal?The stability spec of +/-25ppm over temperature is not to be confused with accuracy, the part has no tolerance spec for that.

author: thm_w
author_rank: Super Contributor
timestamp: December 30, 2021, 01:48:39 am
content: Quote from: floobydust on December 30, 2021, 01:22:37 amThat doesn't make sense, because then they could sell you a 35kHz crystal.Should be 32.768 + tolerance + agingQuotehttps://www.allaboutcircuits.com/technical-articles/characterizing-frequency-deviations-of-quartz-crystals-frequency-tolerance-frequency-stability-and-aging/

author: floobydust
author_rank: Super Contributor
timestamp: December 30, 2021, 02:28:20 am
content: I think it's the usual vague datasheet, there's no details about the "frequency stability" spec conditions. Sometime this is because the "crystal industry" assumes everyone knows the defaults.But e.g.Abracon ASH7Kgive center frequency, and frequency tolerance at room temp. after 2x reflow. Frequency stability is another spec. - over temperature. This makes sense to me.MaximDS32KHZgives no tolerance on center frequency beyond including temperature, so it's as if the spec includes both absolute freq tolerance and temperature when they say +/-2.0ppmOP with your oscillator ensure power is not noisy at all, good decoupling cap present, otherwise noise can cause higher freq. than expected.The module would have a buffered output good to 15pF load so I can't see it being upset with your active probe. If you cooked the module during soldering, or VDD is higher than the module expects, I could see the frequency being skewed.

author: nomar123
author_rank: Contributor
timestamp: December 30, 2021, 03:18:04 pm
content: Thanks, i now see that the buffered output on that module is 15pF so my probe should not be aggressively loading down the output.I checked my supply and it looks pretty good, but I noticed that the decoupling cap is far away from the module and not in a place where you would expect it (this is a legacy design that i inherited, I would not have made that design choice). So that could be contributing factor. I was able to rework the board and added a 0.1u decoupling cap at the pad of the modules ground pin, then ran a short wire to the supply. I am concerned that this is not adequate decoupling still because i needed to run a wire. When I tested again I am still around 2.5hz slower than the desired 32.768kHz desired frequency.I also checked the supply and it is a solid 3.3V.I also checked another board with the same part and got similar results. So I think an error in soldering causing failure is unlikely unless all builds were subject to that error.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: December 30, 2021, 04:00:20 pm
content: If you check multiple boards and get the same error, that would make me suspicious of the test method or a consistent problem with the design.

author: niconiconi
author_rank: Frequent Contributor
timestamp: December 30, 2021, 04:41:23 pm
content: Quote from: nomar123 on December 29, 2021, 09:52:45 pmI'm not sure about RTC crystals - but for digital clock crystals at several MHz, yes, ideally you need to avoid direct measurements at the crystal completely, even 1 pF of extra load capacitance creates an offset of a few ppm. Using a programmed clock output is a reasonable solution. Another good method to minimize the loading error is using an electric field or magnetic field probe for EMI troubleshooting, placing the probe above the MCU, and feeding the output to a spectrum analyzer and turn the RF preamp on. This way, you're basically just receiving a radio signal from the crystal. The spectrum analyzer ideally needs to have a crystal oven timebase, so the error from the analyzer itself is below 1 ppm. Using a radio time signal is a cheaper alternative.For 32.768 kHz RTC crystals, I don't think RF near-field probes are going to be effective. I suggest using a clock output by programming the chip.I wonder if the old-school method of using a Lissajous figure using the X-Y mode is an effectively solution to measure an RTC oscillator. If you have a signal generator with a good timebase, you can feed a 32.768 kHz reference signal to one channel, and feed the RTC-under-test to another channel. Their frequency and phase difference is visualized by the shape of the Lissajous figure and the difference is easily determined. Without a timebase, perhaps one can use the WWVB 60 kHz radio signal. But the problem is that their ratio is not an integer multiple and that calls for a fractional-n synthesizer, and the project is becoming out of scope.Quote from: nomar123 on December 29, 2021, 09:52:45 pmIt shouldn't be a problem then, if it's already buffered.

author: nomar123
author_rank: Contributor
timestamp: December 30, 2021, 04:48:28 pm
content: I am convinced it is a design issue as I think we determined on here that I shouldn't be loading down the measurement with an active probe. Do you have any recommendations on where to look for proper way of implementing a CMOS crystal oscillator module like the TC25L5I32K7680? I can't seem to find much in the datasheets or online for recommendations for layout or general design rules. What other layout issues could potentially cause issues at the output of one of these modules? I have already identified that decoupling is not ideal, but are there any other areas I should think about?Appreciate all the help so far.

author: magic
author_rank: Super Contributor
timestamp: December 30, 2021, 04:58:18 pm
content: Is there any real world problem with this device?You say it's 76ppm off. That's 40 minutes per year, 3 minutes per month, 7 seconds per day.No way you wouldn't notice the error if it were real.

author: niconiconi
author_rank: Frequent Contributor
timestamp: December 30, 2021, 05:24:58 pm
content: Quote from: nomar123 on December 30, 2021, 04:48:28 pmI still heavily suspect a measurement error unless proven otherwise. What is the model number of your oscilloscope? Most oscilloscopes in general are not designed for accurate frequency measurement. A frequency counter (or spectrum analyzer) with a good and calibrated timebase is traditionally used for that purpose. If you must do it on a scope, I suppose you can do a relative comparison if you have a known-good reference signal, either a radio, GPS, or signal generator with an accurate timebase.The timebase on many oscilloscopes are 10 to 50 ppm. That already creates a huge error. Some scopes have a 1 ppm timebase, which is great, but you said the "the timebase accuracy is ±1.0 x10-7", that translates to 0.1 ppm. That must be a top-of-the-line scope, I suppose? Or have the oscilloscope vendors in recent years decided that high-quality clock modules are cheap enough and they all started using them when I was not looking?Also, most test equipment specifies a 20-minute warmup time before the timebase is able to reach the specification, so better to follow that as well. Oscilloscope manuals also suggest running self-calibration if the ambient temperature has changed more than a few degrees C (but I don't think it affects timebase accuracy).Temperature drift is another factor, but I don't think it's significant at 20-30 degrees C at room temperature. The reference temperature is 25 degrees C.

author: niconiconi
author_rank: Frequent Contributor
timestamp: December 30, 2021, 05:32:17 pm
content: Also, correct me if I'm wrong, but inadequate power supply decoupling should only be responsible for short-term frequency instability in the form of jitter (aka phase noise) at the time scale of nanoseconds or microseconds. It should not cause a long-term frequency error at a scale of minutes, and definitely not a 76 ppm error for a 20 ppm crystal.

author: niconiconi
author_rank: Frequent Contributor
timestamp: December 30, 2021, 05:42:12 pm
content: Also, the aging of your clock oscillator is 3 ppm to 5 ppm per year. If you are trying to measure a project from five years ago, there can be an up to 25 ppm drift due to its age, which is normal. I still think it's a measurement error if you see an error of 76 ppm, but the 25 ppm aging could be a part of it.

author: nomar123
author_rank: Contributor
timestamp: December 30, 2021, 07:09:31 pm
content: Quote from: niconiconi on December 30, 2021, 05:24:58 pmI have access to a pretty high end scope, tek MSO64. I have made several frequency measurements in the past using the histogram function and I often get a solid distribution around the desired frequency, sure there are hits on either side but the majority of the hits are where I would expect them to be. that is why this RTC deviation is leading me to believe it is not the measurement and it is truly off. I am going to try to figure a way to test the RTC over a few days and see if there is a noticeable drift.I have given the scope plenty of warmup time before making my measurement, so I don't think there is an issue there. Also, I have a pretty constant 25C room temp so I don't believe we are seeing a temperature drift.

author: nomar123
author_rank: Contributor
timestamp: December 30, 2021, 07:16:09 pm
content: Quote from: magic on December 30, 2021, 04:58:18 pmNo real world issues I have found at this point. I am working on running a test where i set up the RTC and let it run over a few days and try to see if there is any noticeable drift, from what I can tell the RTC is not used right now, but it is going to have to be implemented in the next phase. I noticed this issue when i was qualifying the hardware. The design was inherited and I am trying to make sure it is solid before another round of units get built. Just want to be absolutely sure I'm not having problems with RTC frequency before moving ahead

author: emece67
author_rank: Frequent Contributor
timestamp: December 30, 2021, 07:19:08 pm
content: .

author: nomar123
author_rank: Contributor
timestamp: December 30, 2021, 07:24:52 pm
content: Quote from: emece67 on December 30, 2021, 07:19:08 pmyeah, typo. Meant to say my measured frequency is 32.765451kHz, which is 2.54Hz less than the target frequency of 32.768kHz

author: niconiconi
author_rank: Frequent Contributor
timestamp: December 30, 2021, 08:19:12 pm
content: Quote from: nomar123 on December 30, 2021, 07:09:31 pmThanks for posting this. I'm now fully convinced. I reviewed the spec and found MSO64's timebase has an initial accuracy of 12 ppb, drift is 20 ppb over full temperature range, and aging is 300 ppb/year. This must be a crystal oven.The performance verification guide (https://download.tek.com/manual/6-Series-MSO-Spec-and-PV-077146100.pdf) saysQuoteIt should be accurate well below 0.001 Hz.And you're using an active probe as well.Suppose nothing we haven't thought about went wrong (software bug? unlikely. Perhaps the frequency measurements used for the histogram input need to be counted and averaged for a longer time to get reliable results, but the scope's counter didn't do this? I don't see how...), I'd say the results are trustworthy.But I agree, it's better to double check the RTC over a few days and see if a drift really exists.Now the mystery deepens. If the measurement is correct, what could've caused the crystal oscillator module to go out of spec significantly!?This is a oscillator module, not a crystal, so bad layout or loading capacitance is very unlikely. Could it be mechanical stress? Thermal stress in reflow soldering?Be sure to keep us posted about your investigation.

author: bob91343
author_rank: Super Contributor
timestamp: December 30, 2021, 10:49:45 pm
content: Why not just cannibalize a cheap watch?

author: floobydust
author_rank: Super Contributor
timestamp: December 31, 2021, 12:10:36 am
content: I find a watch isn't a great reference because its temperature is up while being worn, and it cools when sitting on the dresser. So you calibrate them in the middle (temperature) which is still not ideal.If I were OP I would contact CTS engineering and ask them why the module appears to be out of spec. They'll have more knowledge.Another experiment is to add loading capacitance and freq. should not shift... but some oscillator modules do rely on their raw output for feedback and are affected.