Frequency Measurement

It is necessary to know the magnitude of the frequency error to be able to compensate for it. Therefore, the frequency of the crystal must be measured. The measurement must be performed when the crystal and device are mounted on the PCB.

Multiple measurements over a range of temperatures will typically give better results, compared to relying on the manufacturer's data.

The frequency of the 32.768 kHz crystal oscillator can be measured using an external measurement tool, or by using an internal resource. When using an external tool, this tool will take the frequency of the crystal as input. When using an internal resource for measurement, for example a timer/counter, a high-precision reference must be supplied. The precision of the measurement will never be higher than the precision of the reference, as the reference is what the 32.768 kHz crystal frequency is compared against.

In both cases, it is important that the crystal is given time to start up and settle before the frequency is measured.