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

A 32.768 kHz crystal RTC drifts farther after trim. Did the MCP7940N leave coarse mode?

An MCP7940N board uses a 32.768 kHz passive crystal for timekeeping. Production measures the frequency error, writes a trim code, and observes a clear change at the test output. The unit passes. Later the calendar drifts more than an untrimmed unit. If the test used coarse mode, check the exit step and its register readback. The fast adjustment that makes a diagnostic easy to see must give way to the slower correction used for normal timekeeping.

Use the output to identify a fixture state left enabled

The MCP7940N normally adds or subtracts a small number of crystal cycles in the timekeeping path each minute. Coarse mode applies corrections much more often, magnifying the observable effect of the code. Microchip warns that leaving the mode enabled causes inaccurate normal timekeeping. Under main power and with square-wave output enabled, MFP supplies a nominal 64 Hz clock in coarse mode. Ordinary mode selects output through its square-wave frequency setting. Read CRSTRIM in CONTROL and check MFP to avoid confusing a diagnostic clock with the actual frequency of the 32.768 kHz passive crystal.

Use the same board for a demonstration and return test. Keep temperature, supply, and pullup fixed. In normal mode, select the highest-frequency square wave that follows the oscillator and record it. With the product's actual wiring and the square-wave function enabled, enter coarse mode and compare a zero trim against a small nonzero one. Check for the nominal 64 Hz output and establish whether changing the sign causes a repeatable change in direction. A visible change shows that the diagnostic path responded. Its frequency shift should not be converted directly to seconds of daily correction in normal mode.

On exit, keep the normal trim value and explicitly clear the coarse-mode bit. Use a read-modify-write to preserve the other CONTROL bits, including clock input and alarm functions, then read back the result. A production tool should restore the state on success, cancellation, and error exits. A separate final check can verify the bit and log it with the serial number. Logging only the last value the tool intended to write cannot catch a bus transaction that never updated the part.

Recalculate the normal correction

In normal mode one code step corrects two cycles per sixty seconds. A 32.768 kHz passive crystal provides an ideal 1,966,080 cycles per minute. Two divided by that number, times one million, is approximately 1.017 parts per million. Suppose the oscillator is twelve parts per million fast. Select the sign for correcting fast time and a magnitude of twelve. Removing twenty-four cycles per minute is approximately 12.207 parts per million of correction, leaving a residue near −0.207 parts per million. This calculation assumes stable temperature and a small-error linear approximation.

Twelve parts per million would gain about 1.037 seconds per day. The illustrated normal correction leaves a quantization residue equivalent to losing roughly 0.018 seconds per day. Temperature, loading, supply, and reference error still contribute in practice. Starting and stopping a stopwatch inside one minute while watching whole calendar seconds can miss changes on this scale. Timestamp one-hertz edges in the normal configuration and observe several full correction cycles.

Individual one-hertz intervals need not be identical because the normal trim periodically changes the count. In a short ten-minute run, save every timestamp and confirm the capture spans repeated full minute corrections. A longer elapsed-time check verifies accumulation. Distinguish the short sign check, long-window residue, and the test temperature and reference for each. That makes it possible to revisit mode, sign, magnitude, and duration independently.

After changing the crystal lot, retain paired readings from before and after correction for each board. A shift in the raw frequency distribution can explain a corresponding change in normal trim values. If most boards have nearly the same code but accumulate large errors after using one fixture, check that fixture’s exit and restart logs. Where one board falls outside the correction range, verify the high-frequency square wave with a reference instrument and inspect loading and soldering. Clamping the code at the last step may improve the reading while concealing an out-of-range board.

Identify the supply and pin mode when there is no output

The data sheet says the square-wave output is unavailable on backup power. Loss of MFP output after switching supplies does not imply the passive crystal stopped. Compare the RTC time with a reference after returning to conditions that permit normal reads. If 64 Hz is absent on main power, check square-wave enable, pin mode, and the pullup before blaming the coarse setting. Where output and register state appear inconsistent, retain the data-sheet revision, actual code, and measured mapping. The displayed name of a production tool mode is weak evidence.

Final acceptance can use normal-mode readback, the correct sign and magnitude, a valid observation interval in normal operation, and an accumulated-time comparison. A clear coarse waveform is evidence that diagnostic settings took effect. Timing performance belongs to the state the board will actually ship in.

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.