none
Time drift of 5 seconds with imx53 internal RTC RRS feed

  • Question

  • Hi,

    Our system is based on imx53 QSB evaluation board based system with WINCE 7.0 OS. We have external RTC but on power on we sync external RTC with internal RTC and further onwards We use internal RTC for other time calculations. internal RTC is not battery backed, only external RTC is battery backed.

    We see 5 seconds time drift per day when we read time at desktop level of WINCE OS.

    Calls to OEMGETREALTIME () will get the time from internal RTC only. call to OEMSETREALTIME () will update both internal and external RTC time.

    Why this drift happens? How to resolve this drift? We don't want to get time from external RTC every time.

    Regards,

    Rambabu


    Tuesday, August 11, 2015 2:56 PM

All replies

  • Assuming that your code isn't writing to the internal RTC except when the time changes, your internal RTC is entirely hardware controlled. So if it is not keeping time, you have a hardware problem. If it were me, I would (in no particular order):

    1. Check with Freescale to see if there are any errata for the RTC
    2. Review your hardware design with your local Freescale FAE
    3. Review your hardware design against the imx53 manuals to confirm that it is correct with regards to the clocks
    4. Confirm that you aren't writing to the internal RTC by debugging your RTC code

    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    Wednesday, August 12, 2015 12:47 PM
    Moderator
  • You could also be using software date/time, rather than processor/hardware date/time. In that case, the software date/time are kept by incrementing each time a timer tick of a known frequency occurs. If you are disabling interrupts, including the timer tick, you can miss some ticks and over time get incorrect date/time. This used to be a problem with Windows Mobile devices where any significant interrupt-disable operation resulted in the time being wrong. If you are really just reading the RTC registers managed by hardware in the processor and not sensitive to interrupt availability, as Bruce says, your hardware is broken.

    If you have an external, battery-backed RTC, why wouldn't you modify your BSP to use it for all date/time operations? You'd always have the "right" date and time and not have to worry about copying on startup and possible loss of time.

    Paul T.

    Tuesday, August 18, 2015 7:58 PM