# Crystal Accuracy Problem

Discussion in 'Embedded Systems and Microcontrollers' started by eepty, Feb 8, 2015.

1. ### eepty Thread Starter New Member

Sep 11, 2012
7
0
I am using a 32.768kHz crystal for a ARM M0+ MCU. According to the specification, the crystal tolerence is 20PPM, and the loading capacitance is 12.5pF. I connect the crytal to the MCU and a capacitor between each of the crystal terminal and the ground. By calculation (considered the PCB and MCU stray capacitance), each of the capacitor is about 18pF (SMD type).

For checking the accuracy, I make use of the MCU's timer periphral to generate a signal from the crystal and checking the frequency by a frequency counter. I found that the error is about 650PPM, which is much higher than my expectation. I tested the loading capacitor with different value but the result is similar. The ambient temperature when I test the crystal is at room temperature (~24C). I have also tested it with the integrated Real Time Clock (RTC) periphral, the result is similar. The RTC error is about 700PPM after two days.

I would like to ask is it normal that the actual error is so high for using a 20PPM crystal? If not, what is the possible reason for that?

Thank you very much.

2. ### MikeML AAC Fanatic!

Oct 2, 2009
5,451
1,071
I think your code is introducing the error.

18th = 589.824 kHz
19th = 622.592 kHz
20th = 655.360 kHz

If you hang a scope probe on the crystal, you will pull it.

Last edited: Feb 8, 2015
3. ### MrChips Moderator

Oct 2, 2009
14,517
4,280
That is not a valid way of testing. How do you know the error of the MCU time base? You need to compare your 32768Hz against an accurate time base.
1ppm error will cause a drift of 1 second after 12 days. You ought to aim for 0.1 ppm to give a stability of 1 second in two months. To get this kind of accuracy one will usually replace the input capacitor with a 30pF timmer cap.