DT_Elapsed timer, how to compensate for inaccuracy over long periods ?


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2010
    Posts
    14

    Default DT_Elapsed timer, how to compensate for inaccuracy over long periods ?

    Using Darrel Taylor's Elapsed_INT-18.bas and running it over a period of 62 hours and 33 minutes the timer appears to be running fast by Approximately 5 minutes.
    Could it be my 20 mhz clock is off frequency causing this? If so what would be a good way to compensate for this? I need this to be somewhat more accurate then it is. Time from the timer was compared against MS Windows desktop clock. I would think it would be fairly accurate to compare against that.
    Total windows time was 62 hours 33 minutes and timer was 63 hours and 38 minutes.

    Thanks,
    Bryan

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: DT_Elapsed timer, how to compensate for inaccuracy over long periods ?

    PC clocks are usually horrible time keepers.
    I had the same problem a while back, thinking the PC would be accurate.

    Syncronize the time on the PC with an NTP server before starting the test, and sync it again at the end of the test.
    You'll be amazed how far off the PC's clock is.

    Also, is your 20Mhz source a crystal, or a resonator?
    Resonators are no good for time keeping.

    I've tested the elapsed timer to hold within about 4 seconds a week. (with a good crystal)
    DT

  3. #3
    Join Date
    Jul 2010
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: DT_Elapsed timer, how to compensate for inaccuracy over long periods ?

    I'll try that. I don't have a manual way to sync the PC's clock to a time server as it is locked out and is updated by a local server. So, I don't know exactly when it's clock is updated to a time server. I try to find a better way to compare the time to.

    Thanks,
    Bryan

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: DT_Elapsed timer, how to compensate for inaccuracy over long periods ?

    If you really want accurate timekeeping, you can set up an interrupt on zero-crossings of the AC power line.
    Or - If you are brave, I can send you a portion of a program I wrote that contacts NTP time servers (requires a Lantronix XPort or similar) and PBPL.
    Or - if you are outdoors, you can get time from a GPS module.
    Charles Linquist

  5. #5
    Join Date
    Jul 2010
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: DT_Elapsed timer, how to compensate for inaccuracy over long periods ?

    Quote Originally Posted by Charles Linquis View Post
    If you really want accurate timekeeping, you can set up an interrupt on zero-crossings of the AC power line.
    Or - If you are brave, I can send you a portion of a program I wrote that contacts NTP time servers (requires a Lantronix XPort or similar) and PBPL.
    Or - if you are outdoors, you can get time from a GPS module.
    Thanks,
    Turns out it was the PC clock was updated by the time server during the period I was monitoring the timer. Found that the timer code/circuit keeps very accurate time for my needs.

    Bryan

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts