Shop OBEX P1 Docs P2 Docs Learn Events
Can the Propeller chip keep time — Parallax Forums

Can the Propeller chip keep time

shankershanker Posts: 12
edited 2009-03-27 15:31 in Propeller 1
Hello All
Just a quick question can the Propeller chip keep time. I am sure it can but I don't know where to start? any one got any ideas ?

Comments

  • KyeKye Posts: 2,200
    edited 2009-03-25 21:29
    No, it can't.

    You can however keep time for short intervals but after days and weeks the clock will really start to drift off out of sync. Unless you have some compensation.

    Use a real time clock, they are specially designed for keeping time.

    If you want to try however check out the object exchange for a real time clock object that uses the propeller, some one has already created it a program that does what you want.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • shankershanker Posts: 12
    edited 2009-03-25 21:35
    Thank you Kye. Is there any other suggestions you have for the beginner ?
  • DelusDelus Posts: 79
    edited 2009-03-25 21:38
    yes but only so long as it has power. Our university club has a prop hooked up to a computer monitor in our office to display messges and the time, it may loose or gain a few seconds over a given period but we haven't noticed anything drastic. here's what we use:

    'initialization
    waittim := cnt + 80_000_000 'at 80MHz operation
    ... 'other initialization code
    'main loop
    repeat
    ... 'code to execute every second
    waitcnt(waittim) 'wait for next second
    waittim += 80_000_000 'increment variable
  • shankershanker Posts: 12
    edited 2009-03-25 21:42
    Well the idea that i have is building a small device much like a time casual that you can store small files on and it keep time. that has a solar panel for power.
  • DelusDelus Posts: 79
    edited 2009-03-25 21:49
    You should probably look into the real time clock IC as Kyle suggested. But I haven't done any thing requireing keeping acurate time for more than a few days so I'm no expert.
  • virtuPICvirtuPIC Posts: 193
    edited 2009-03-25 21:58
    For long term time measurements you need an accurate clock generator. If you buy a normal crystal look at the data sheet. You can expect maximum errors between 10 PPM and 100 PPM. 10 PPM is about one second per day, one minute per every two months. Conclusion: You have to calibrate a crystal driven time keeper, no matter if it is a prop or an RTC chip. The good news is that you can compensate it in your software if you use the prop. Just count 80_000_800 clock cycles if your crystal is 10 PPM faster than it should. Yes, you need a reference to compare. If you give your clock 24 hours to run freely and compare with the reference after that you can estimate how fine you will have to measure the difference...

    Thisbrings us to the second option. There are numerous time LF reference radio transceivers worldwide. There is at least one in the US, one in the UK, one in Germany, one in Switzerland, and one in Japan. They send at an accuracies of better than 1 PPB. Frequency as well as time. If you use this time you even get two more benefits. You get the official time and you get automatic adaptation to DST and leap seconds. For a few dollars you can buy small radio modules giving digital output that can be decoded by the prop.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2009-03-25 22:28
    shanker said...
    Thank you Kye. Is there any other suggestions you have for the beginner ?
    Might I suggest you start by reading the Propeller Education Labs Fundamentals·book?· It is a free download from this product page.· Chapter 4 is on I/O and Timing Basics, and includes a timekeeping applications section at the end of the chapter.

    -Stephanie Lindsay
  • shankershanker Posts: 12
    edited 2009-03-25 23:16
    Thanks I will look into that chapter also Thank for the idea with LF reference radio transceivers worldwide. Thank you. =)
  • mctriviamctrivia Posts: 3,772
    edited 2009-03-25 23:43
    RTC are a very cheap way to go and are very easy to use. The one I use on my propmodule can keep time without power for months using a tiny 9mm rechargeable battery. If you are planing to use solar power you will want to look into a boost/buck switching regulator and rechargeable batteries or a super capacitor(I got a 5.5V 1F cap that is the size of 4 quarters stacked on top of each other).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
  • SRLMSRLM Posts: 5,045
    edited 2009-03-27 15:15
    I'll have to disagree, yes, the propeller can keep accurate time (with some stipulations). I'm working on a clock project right now, and in a couple of weeks I'll be able to post my code in the completed projects forum. Anyway, take a look at these threads:

    General timekeeping:
    http://forums.parallax.com/showthread.php?p=776732

    Propeller timekeeping:
    http://forums.parallax.com/showthread.php?p=777425

    Basically, you'll need to find out the error of the crystal and keep it at a constant temperature to be able to use a propeller for time keeping. It isn't perfect, but it shouldn't loose more than a second or so a day (guestimation).
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-03-27 15:31
    SRLM,

    Have you seen this thread?· It is in aggreance with your second or so a day time difference.

    http://forums.parallax.com/showthread.php?p=791201

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.