Shop OBEX P1 Docs P2 Docs Learn Events
Real Time Clock — Parallax Forums

Real Time Clock

GrogoroskyGrogorosky Posts: 6
edited 2008-06-19 12:44 in BASIC Stamp
Is possible to make a Real Time Clock with the Stamp 2? If not, someone has any experience with it? Any advice? ...thanks...

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-04 23:22
    It's not really possible to make a real time clock with the Stamp. Even though the Stamp has a crystal based clock that's used for timing in various statements, there's no way to accumulate accurate times. You really need some kind of accurate external time standard. There are several Nuts and Volts Columns downloadable from Parallax on attaching a real time clock to a Stamp.
  • GrogoroskyGrogorosky Posts: 6
    edited 2008-06-05 00:08
    Thanks Mike, could you please address me in order to get in those links? Sorry but I´m really new with these issues...
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-05 00:18
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-05 15:00
    Depending on what you are looking for, the BASIC Stamp has been used many times for custom Real Time Clocks. Each of the following uses an RTC chip and additional hardware, however it may help you. Take care.

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

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

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

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

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

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • GrogoroskyGrogorosky Posts: 6
    edited 2008-06-10 20:31
    Thanks so much Chris
    This forum and its people is absolutely·GREAT!yeah.gif
  • ercoerco Posts: 20,259
    edited 2008-06-11 01:04
    Your post made me curious to play with a simple timing loop on my BS1 Project board today. I wrote the 12-hour timer program below that simply displays H:M:S using the debug command. It could be calibrated over a period of time by tweaking the pause command by trial & error. Or rather, "empirically determining the coefficients of performance." Expanding the program by inserting IF checks would slow it down and require further calibration. Debug is a very slow command, and the actual execution time may vary depending on whether the variables are single- or double-digit. But it may be accurate enough for certain short-term timer applications. BS2-class code could be similarly contrived.


    ' {$STAMP BS1}
    ' {$PBASIC 1.0}
    start:FOR B0=1 TO 12' hours
    FOR B1=0 TO 59' minutes
    FOR B2=0 TO 59' seconds
    DEBUG # B0,":",# B1,":",# B2,CR
    PAUSE 781
    NEXT
    NEXT
    NEXT
    GOTO start

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-06-11 13:36
    I'm not sure how stable the Resonator-based oscillator is over time and temperature and power fluctuations -- that's why a battery-backed 1302 clock chip is so nice.
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-06-11 17:46
    For a short term clock, there are several Penguin Robot programs
    that do counting, timing and remain relatively accurate. The program
    statements are timing sensitive so be aware of any mods.

    The Brain Timer handles minutes, and Tiny Timer does seconds.
    The others are sequential counters that can be modified for time.
    These work on Penguin Robot's BS2px-24 microcontroller.

    penguin_tiny_timer.bpx
    http://forums.parallax.com/showthread.php?p=677138

    penguin_brain_timer.bpx
    http://forums.parallax.com/showthread.php?p=686766

    penguin_basic_counter.bpx
    http://forums.parallax.com/showthread.php?p=691831

    penguin_continuous_counter.bpx
    http://forums.parallax.com/showthread.php?p=685643


    humanoido
  • GrogoroskyGrogorosky Posts: 6
    edited 2008-06-19 12:44
    Hi Erco!
    thanks for your post!
    In my understanding is very difficult to make a RTC with a standard cristal clock, probably for a short term clock could work (i.e. 2 or 3 hours clock), but even calibrating the loops the clock will carry milliseconds (more or less milliseconds) in the minutes, it will carry minutes in a day, and hours in a week, and so on. That´s why all depend of the cristall basically.... best regards...
Sign In or Register to comment.