Shop OBEX P1 Docs P2 Docs Learn Events
Propeller RTC (Real Time Clock) Emulator - DEMO — Parallax Forums

Propeller RTC (Real Time Clock) Emulator - DEMO

Beau SchwabeBeau Schwabe Posts: 6,566
edited 2013-05-02 11:40 in Propeller 1
Inspired by a thread·posted in February·... "System clock as 7 day to 24Hour real time clock?"



This object emulates an RTC (Real Time Clock) using the timebase of the Propeller. Accuracy is only as good as the crystal. In my testing, there was about 2 seconds lost over the course of 1 day ( ~ 12 minutes a year)

An object has been posted in the Object Exchange

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

IC Layout Engineer
Parallax, Inc.

Comments

  • mctriviamctrivia Posts: 3,772
    edited 2009-03-11 18:17
    that is nice but the advantage of an rtc chip is the battery backup. I normally read the time at boot and keep the time in a modified UNIX Epoch time format where 0=January 1st, 2009 UTC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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.
  • CassLanCassLan Posts: 586
    edited 2009-03-11 22:05
    Thanks Thats Awesome!
  • BradCBradC Posts: 2,601
    edited 2009-03-11 22:36
    Beau Schwabe (Parallax) said...
    This object emulates an RTC (Real Time Clock) using the timebase of the Propeller. Accuracy is only as good as the crystal. In my testing, there was about 2 seconds lost over the course of 1 day ( ~ 12 minutes a year)

    Just a note on the accuracy. I did this and have been running one of these since late 2007 and have logged and compared the time every 10 seconds over that period (with a stratum 3 NTP time server), and in my particular case (which is a plain proto-board) 2 seconds was the absolute maximum. I was averaging more like 1.2-1.5 Seconds a day over the year. It's not that ugly.

    The DS1307 is a lot better, but it's not perfect either.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cardinal Fang! Fetch the comfy chair.
  • T ChapT Chap Posts: 4,223
    edited 2009-03-11 22:59
    This will be great for playing around with. For some applications on a network it will be fine anyway, it can just request the date and time on any reboot. You could also create a method to bias out the average loss if needed.
  • papasmurff11papasmurff11 Posts: 1
    edited 2013-04-30 11:50
    If anyone is still looking at this thread, I am pretty new to propeller chip coding, and was wondering if anyone would be able to show me instructions or explain to me how to use this RTC Emulator. I have it downloaded, but I can't really tell what is being output and where, and how many cogs it is using.

    In the end I am making a program that I essentially want to just print out the current time, so I am just wondering how I would go about doing that.

    Thanks!
  • kwinnkwinn Posts: 8,697
    edited 2013-05-02 11:40
    If you unzip the download into a folder and use the prop tool to compile the demo program it should display the start time on the PC if you have PST running on the PC. The demo program sets the date/time to March 11, 2009, 12:00 PM and then displays the updated time continuously after that.
Sign In or Register to comment.