cancel
Showing results for 
Search instead for 
Did you mean: 

RTC time shift in seconds for a day

aru
Associate II
Posted on November 23, 2013 at 14:58

I have implemented RTC in STM32F107RB at 50Mhz operating frequency, it works good but the problem is shift in time about 5 to 6 seconds in a day. Is there any correction factor?  Here i have attached  RTC intialisation code

2 REPLIES 2
Posted on November 23, 2013 at 15:15

I have implemented RTC in STM32F107RB at 50Mhz operating frequency, it works good but the problem is shift in time about 5 to 6 seconds in a day. Is there any correction factor?  Here i have attached  RTC intialisation code

50 MHZ?

Well if you can't get the frequency of the clock right, then one of your alternatives is to determine the clock drift and how the bias accumulates over time, and periodically slew the time count, ie determine number of seconds over which a second of error accumulates, and then after that period (or multiples there of) slew the clock to adjust, and remember the last time you did it.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
aru
Associate II
Posted on November 25, 2013 at 06:25

thank you,

i will implement what u mentioned