Time Stability

Discussion to talk about software related topics only.
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Time Stability

Post by SeeCwriter »

There are a couple of long threads on the forum about time that I've read through and not found an answer to my question. I'm using the MOD5441X and a battery-backed external RTC chip. On bootup the system time is set from the external RTC using RTCSetSystemFromRTCTime. I'm querying for time once a second, and the time drifting fast by about 4 to 5-seconds per hour. I use function localtime to get the time.
Having set the time at 7am this morning, 5.5 hours later it's now about 40-seconds fast.
Is this typical performance? And is there anything I can do to improve the stability, short of just using the RTC for all
time needs?

I'm using v2.8.3 tools.
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: Time Stability

Post by pbreed »

The base crystal should be 20ppm or one second every 14 hrs or so...
This sounds like an off by one error in the BSP setup counter code.

I'll look at it on Wedensday.
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: Time Stability

Post by pbreed »

Ok I just tested the deivide ratio over a long period its supposed to be 62500000, it is in fact 6249984

This is an error of 0.99999744 or about 1 second every 108 hours.
This is swamped by the the 20PPM base clock error of 1 sec error every 13.8 hrs.

So something else is going on with you...

Have you used NTP to track your time to see if the error is real or a real time clock issue?

Any software issue I would expect to cause it to be slow, not fast.

40 seconds fast in 5.5 hrs is : 2020 parts per million.
Did you change ticks per second from the default of 20/sec?
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Re: Time Stability

Post by SeeCwriter »

No changes to ticks per second.

It resyncs with an NTP server one hour after bootup, then every 24-hours. The last resync was at 8am, 2 hrs and 15 min ago. Comparing the time with the current UTC time (http://www.worldtimeserver.com/current_time_in_UTC.aspx) it is about 6 seconds fast.

I too would expect a slowing clock if software was the issue.

We see similar results on the NANO, so it's not confined to one module. Though we don't see this on the MOD5234.
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: Time Stability

Post by pbreed »

Interesting...

Inside nbtime.cpp is a variable...


static time_t TimeOffset;

Add a function that reports that variable after inital NTP snyc and then after subsequent NTP syncs,
I'd like to know how its changing in 24hrs.

(We are running the same test here...)
ecasey
Posts: 164
Joined: Sat Mar 26, 2011 9:34 pm

Re: Time Stability

Post by ecasey »

I have seen this before it was either:
1. The power supply - too much ripple under full load.
2. Or I was trampling memory - something to do with a static HiResTimer class member timing an I2C acquisition loop.

The bigger problem was that the unit was resetting randomly a couple of times per week. I fixed both and the clock now works and the unit doesn't reset.
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: Time Stability

Post by pbreed »

Actually is this a MOD54415 or MOD54417, for this they are different internally, and it might matter....
Also what is the board revision, we recently made a board hardware change to reduce EMI...


Paul
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: Time Stability

Post by TomNB »

I am running a MOD54417 and the External RTC example. Set the time on boot using NTP through the interactive menu. Checking the time against the time.gov site. After more than an hour they match exactly. What are you comparing your time against? Are you saying your RTC is drifting, or the module itself?
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: Time Stability

Post by dciliske »

The issue being reported is that the System time (derived from TimeTick I believe) is drifting. The RTC itself is not drifting, or at least is not being stated to drift.
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: Time Stability

Post by pbreed »

The way I read the description...the System time and RTC are drifting from each other, its not clear which one is actually doing the drifting...
The assumption is that the RTC is good, alas, unless checked against external reference hard to know which it is...

My test against NTP test has been running 2 hrs and 0 seconds drift on MOD54415.
Post Reply