Shop OBEX P1 Docs P2 Docs Learn Events
System clock as 7 day to 24Hour real time clock? — Parallax Forums

System clock as 7 day to 24Hour real time clock?

T ChapT Chap Posts: 4,223
edited 2009-02-09 22:15 in Propeller 1
If there is a loop that is running perpetually, why can't the system clock be accessed each iteration and update a running 7 day 24hour clock for setting timers etc? Looking at real time clock IC's, it seems they are crystal based as well, so whats the difference in using the Prop to maintain it's own internal clock versus a dedicated I2C clock IC?

Comments

  • LeonLeon Posts: 7,620
    edited 2009-02-07 19:59
    Accuracy!

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • KyeKye Posts: 2,200
    edited 2009-02-07 20:20
    And well, If a power outage hapens then there goes your time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • mctriviamctrivia Posts: 3,772
    edited 2009-02-08 04:24
    but a good rtc has the ability to hook a button cell batery to it and keep going for 7+ years with power disconnected. The prop is pretty accurate my code losses only a second/day. I will be connecting a DS32C35-33IND# to it anyways though to get the accurate time on boot up. I will be using a 9v backup for to keep the prop running as long as possible also but in an extreme power outage this will not be enough so having the extra backup is great if you want to make sure you always have the right time.

    If having a human set the time on start up is not a problem then there is no reason not to use the prop as a clock.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-02-09 17:04
    This discussion came up recently between a few colleagues and I. In all fairness the Propeller could very easily use its internal clock as a reference and keep a running RTC within a cog. The crystal that drives the Propeller is pretty accurate overall. The C=64 used the 60 Hz signal from the AC line to drive an internal counter which could be set up for timekeeping (and often was). In that sense if the power goes out you would lose your timebase. But using the Propeller means you could easily have a backup battery and preserve the time. It would take some design-time consideration, however it could easily be done. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Andrew E MileskiAndrew E Mileski Posts: 77
    edited 2009-02-09 22:15
    TChapman said...
    If there is a loop that is running perpetually, why can't the system clock be accessed each iteration and update a running 7 day 24hour clock for setting timers etc? Looking at real time clock IC's, it seems they are crystal based as well, so whats the difference in using the Prop to maintain it's own internal clock versus a dedicated I2C clock IC?
    I posted a program to do the conversion from a 32 bit count to Unix epoch a while back. It really isn't "rocket surgery", though some might be surprised to learn that a year is NOT 365.25 days long but 365.2425 days thanks to leap years.
Sign In or Register to comment.