Shop OBEX P1 Docs P2 Docs Learn Events
Accurate time keeping — Parallax Forums

Accurate time keeping

Macgman2000Macgman2000 Posts: 59
edited 2008-10-29 18:27 in General Discussion
Hello,

I am working on a digital clock project, it will project the time on the ceiling. What do you recommend for an accurate time base? Any external IC's that can be used to output a seconds interrupt on SX pin? Any info would be greatly appreciated.

Nick

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-10-27 02:20
    I recommend a GPS. ·SERIN·the sentence with the time in it.· Gets updated once every second.

    Post Edit -- One such sentence is $GPGLL, it has both time & date.· The time is also available in a few other sentences.

    Post Edited (PJ Allen) : 10/27/2008 2:32:07 AM GMT
  • DynamoBenDynamoBen Posts: 366
    edited 2008-10-27 03:17
    I would suggest a Dallas DS1307. Keeps time for you and can generate a 1 Hz interrupt pulse. I've used it on several projects and love it.
  • RDL2004RDL2004 Posts: 2,554
    edited 2008-10-27 06:14
    How accurate do you need to be and over what span of time? Does it have to run off batteries or can you use power from the wall?

    If you need long term accuracy then GPS is probably the way to go. It isn't cheap though.

    A time base derived from the AC mains power frequency can have good long term accuracy at the expense of variations over the day of a few seconds one way or the other. This is what most most of the clocks you can buy at the store use (assuming they're plugged in to a wall outlet).

    Battery powered devices are most likely going to use some method based on a quartz crystal oscillator. 32.768 kHz is commonly used since when divided by 215 you get 1 Hz. This is how the DS1302 and DS1307 keep time. Accuracy will depend on the crystal. My experience has been that drift of several minutes a month is common, unless you go to the trouble of accurately tuning the oscillator circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick
  • Macgman2000Macgman2000 Posts: 59
    edited 2008-10-28 03:13
    I think I will try the 32.768kHz 7.5 PPM with a 2^15 counter. I have an old GPS (hockey puck) with a 9 pin serial cable, but I don't think that I can receive a signal indoors (middle of the house). I will try it too when I have time.

    Thanks!
    Nick
Sign In or Register to comment.