View Full Version : Can the Propeller chip keep time

03-26-2009, 04:24 AM
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 ?

03-26-2009, 04:29 AM
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.


03-26-2009, 04:35 AM
Thank you Kye. Is there any other suggestions you have for the beginner ?

03-26-2009, 04:38 AM
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:

waittim := cnt + 80_000_000 'at 80MHz operation
... 'other initialization code
'main loop
... 'code to execute every second
waitcnt(waittim) 'wait for next second
waittim += 80_000_000 'increment variable

03-26-2009, 04:42 AM
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.

03-26-2009, 04:49 AM
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.

03-26-2009, 04:58 AM
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 (http://www.airspace-v.com/ggadgets) for tools & toys

Steph Lindsay
03-26-2009, 05:28 AM
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 (http://www.parallax.com/Store/Microcontrollers/PropellerProgrammingKits/tabid/144/CategoryID/20/List/0/SortField/0/Level/a/ProductID/415/Default.aspx).· Chapter 4 is on I/O and Timing Basics, and includes a timekeeping applications section at the end of the chapter.

-Stephanie Lindsay

03-26-2009, 06:16 AM
Thanks I will look into that chapter also Thank for the idea with LF reference radio transceivers worldwide. Thank you. =)

03-26-2009, 06:43 AM
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 (http://propmodule.com) has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.

03-27-2009, 10:15 PM
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:

Propeller timekeeping:

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 Schwabe
03-27-2009, 10:31 PM
SRLM (http://forums.parallax.com/member.php?u=53784),

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


Beau Schwabe (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.