This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Understanding Trim Value for adjusting RTC Oscillator on TM4C129ENCPDTI3

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

  • Hello Bill,

    The trim that needs to be adjusted is the extra set of ticks that are being done in a second worth of count. In this particular case the RTC clock is off by 1 tick every second (32769-32768). To account for the fractions it would 1.52 tick every second. So over 64 seconds it would 64*1.52 which would mean 97 ticks that need to be adjusted. Thus the new trim value applied would be 0x8060.

    However do bear in mind that when the RTCCLK is taken out on a pin there is a jitter that gets accumulated due to the probe, board and the on-chip variations.

    Regards
    Amit