Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / Measurement and Acceptance

Why does the reported offset of a 32 MHz crystal change with LPC55S69 FREQMEAS window size?

A counter on a buffered node finds the 32 MHz quartz crystal close to nominal. Production firmware on an LPC55S69 says it is almost 1,000 ppm slow. Increasing the FREQMEAS window reduces the reported offset on the same board. Export the raw count and conversion. Using one reference count too many in the denominator can make the shorter measurement distinctly low.

Export the window definition and raw count together

NXP's LPC55S69 MCUXpresso SDK gives the target frequency as CAPVAL times the reference frequency divided by (1 << SCALE) − 1. It also describes separate target and reference selectors in INPUTMUX. Check the actual connections and selectors. With suitable clock routing, use the 32 MHz crystal path as the target and an independently calibrated source as the reference. Report the active selectors and verified reference frequency together with the configuration intended by the firmware.

Suppose the verified reference is 1.000000 MHz and SCALE is 10. The denominator is 1,023, representing 1.023 ms for this calculation. The ideal CAPVAL for a 32 MHz target is 32,736, which gives exactly 32 MHz under the documented expression. An implementation that divides by 1,024 instead reports 31,968,750 Hz, or about −976.563 ppm. Both results can be obtained from the same raw sample.

With SCALE set to 14, the denominator is 16,383 and the calculated window is 16.383 ms. The ideal count is 524,256. Using 16,384 by mistake gives 31,998,046.875 Hz, roughly −61.035 ppm. The two errors differ by a factor of sixteen. A longer window can appear to cure most of the problem before the conversion is corrected.

Recalculate the same count before changing the hardware

Capture several raw results at both window lengths. Keep the reference, signal routing, and levels unchanged. Record completion status so a result from the previous window is not associated with a new SCALE. Recalculate the log using both formulas and check how the difference follows window length. Where a fixture script applies its own correction, put the independent buffered-node measurement next to both results.

Removing the extra reference count does not change the measurement granularity. In the short example, one CAPVAL count changes the output by about 978 Hz or 30.5 ppm at nominal. In the long example, the step is about 61 Hz or 1.91 ppm. Edge phase, acquisition behavior, and reference uncertainty matter as well. For screening parts that differ by only a few ppm, characterize the long-window spread and use an external verification with a suitable acceptance margin.

The target and reference can also share the same 32 MHz quartz crystal. Both then speed up in the same proportion when the crystal drifts. The ratio can remain accurate. Change the independent reference setting deliberately or verify it against a second source. A derived on-board reference can verify divider ratios and connectivity, while the absolute crystal frequency requires independent evidence.

Change the reference rate by a known ratio while keeping the same target and routing. With the new verified rate passed to the calculation, the target remains close to the previous result while the raw count moves inversely. A result that follows the reference setting warrants inspection of the actual conversion input. The configuration log alone cannot establish a physical crystal shift.

Let the new reference settle and complete a new capture under that setting. Mark acquisition start and end on a test output and keep the counts grouped by condition. This catches firmware that reads on a fixed delay instead of waiting for completion. That delay can appear sufficient at the shorter setting and fail in the longer window.

Use consistent limits to decide what needs correction

When the short window still gives a few discrete results after the formula is fixed and the long window agrees with the bench reading, check quantization and resolution. If both windows retain the same fractional error, independently measure the reference and source rather than subtracting a convenient constant from the output. If results are stale or change in unexpected steps, check completion, register synchronization, and concurrent calls, and retain the start and finish markers.

Replay the two ideal CAPVAL values as a regression test of the production calculator. Also feed it an intentionally offset reference and verify that the report identifies that source. Confirm that intermediate multiplication does not overflow a narrow integer before the division hides it. Keep full precision until converting the result into a display string. These checks catch calculation failures before looking for differences between boards.

Apply a known offset near the production limit and measure repeatability. If repeated readings straddle that limit, record the fraction and use an independent reference for borderline units. A longer window improves count resolution, but reference accuracy still limits screening.

Record the intended use of each window, reference identifier, routing, settings and raw counts. When a replacement 32 MHz quartz crystal agrees with the independent observation at both corrected windows, the original rejection is attributable to the conversion. Investigate the crystal, load, or assembly if an independently measured out-of-limit offset follows the sample after the reference and window calculation have been validated.

References

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.