We are using the Hibernate's RTC mode for maintaining system time on our board. We also have it configured to output the RTC crystal on the pin to measure the RTC crystal output. When we do this we show 32.76952 KHz. So if we divide it by 32.768 KHz (the ideal frequency) we get:
32.76952 KHz / 32.768 KHz = 1.00004638672 Hz
Which shows our crystal running a bit fast. So we need to adjust the trim value to slow it down (which the docs state in RTC mode gets applied every 64 seconds)
My question is how to determine from the above calculations how much should the trim value be adjusted by? Not sure of the "units" within the trim value. The docs states the default trim value is 0x7FFF. So I need to increase this trim value to ??? based on the RTC clock being .00004638672 Hz too fast.
So in other words, if our crystal is of by +/- X number of Hz, how does this relate to the offset to add/subtract to the default trim value of 0x7FFF ?
Thanks,
Bill