RTC frequency not accurate on STM32F103C8 - high ppm value on tamper pin
Hello,
i am using a stm32f103 mcu to provide rtc functionality.
I am using a external crystal of 32768 hz for the rtc block.
The crystal is rated at 6pf load. +/- 20ppm PN: QT1C-32.768KDZB-T
Apart from this i have also implemented a external gps module to provide a "reference time" via uart.
Upon power on, the mcu configure the rtc counter with values for hours,minutes,seconds taken from the the gps, then i just display them on a lcd.
My problem is the time drift on the rtc when comparing the time from the gps
For example, after 10 hours of functionality, my rtc clock drifts with 7-8 seconds when compared with the gps time.
I have tried to measure the rtc clock on the tamper pin, and here things start to show up
The measured frequency on the tamper pin ( PC13) is 512.295hz.
this is giving a huge ppm diference of about 576 ppm.
I have tried with several instruments to measure the tamper frequency, but all are measuring mostly the same deviation of .295 hz
I have also tried a workarround to disable all the remaining preripherals, leaving only the rtc functionality, the same tamper freq deviation is measured.
I have also tried to create a simple CubeMX project only with the rtc tamper functionality, and the same deviation is measured
To be honest i am starting to run out of ideas, any sugestions could help.
a insight of the pcb layout for the X1 rtc crystal.

