Shop OBEX P1 Docs P2 Docs Learn Events
Qustions about an "Autosave Time clock". — Parallax Forums

Qustions about an "Autosave Time clock".

BTXBTX Posts: 674
edited 2007-11-28 01:45 in Propeller 1
Hi all. !!

Well.. I'm trying to get the time, that a popeller is working, and save that data in the eeprom.
I used the Timer rutine from Parallax, and I modified some of this.
My specific problem, is that I can't get the "timer" values·"autosave" in the eeprom...because my code gets crazy at this time in the TV screen.
I did a code, showing all I want to do....and this code works fine ...but in this, I save manually the data in the eeprom, calling the "SaveTime" routine from the main object.
My point is: How to "autosave" that data each one minute....and to forget to do it in the main object, that is to prevent lose the time worked for the system, if the power is cut manually or accidentally in the equipment.

Here's the example code.
Thanks in advance for suggests !! or solutions smile.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.

Alberto.

Envio editado por (BTX) : 11/26/2007 12:09:46 AM GMT

Comments

  • BTXBTX Posts: 674
    edited 2007-11-27 01:47
    Hi all !!
    Nobody has an idea about my problem ? or maybe I can't explain it well ?
    Suggests are wellcome !!
    thx in advance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • PerryPerry Posts: 253
    edited 2007-11-27 03:53
    I suggest you use the "Clock" object supplied by Parallax. There is a good description of it's use in the code.

              t := 0
              Clock.MarkSync
              repeat  ' main loop in program 
    
                         '  your code here
    
                 t++    ' end of main loop 
                 if t//60 == 0
                   save_status_to_eeprom
                 Clock.WaitSyncSec(1)       
    
    


    I use that to sync the main routine to fixed intervals, you just need to know that the main loop will not take more time than the interval of time you wan to use

    Perry
  • BTXBTX Posts: 674
    edited 2007-11-28 00:05
    Thank you Perry !!
    Where can I find the clock object ?? Object exchange or?? I can't found it there......
    Some ideas about of "how to add that chatacteristic to my code"... I can't discover where is my error.
    Each time I want to save the data in eeprom, putting·that code into the updateTimer routine....the TV screen goes crazy and no values are saved.
    I think it is a conceptual error....but still I can't found it.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-11-28 00:31
    It's in the IDE distro.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • BTXBTX Posts: 674
    edited 2007-11-28 01:45
    Thx Paul I saw it yet... (I think, it is not what I need, for my purpose)

    But let me explain again, which is my problem.

    All I want is:
    Know·the time in minutes, that my demo board was in "power on"...without touching anything....and although somebody unplug it from the power line.

    So, some like an RTC (using only minutes)...not necessary too exactly....and where the own code, save the "time" in the eeprom, each minute that the "demo board" was in "power on" state.
    Then, when I came back to my home, and "turn on" the demo board again, I could know the time that the board was "working" in my absence.

    I hope it is clear now...sorry...English·& programming " are not my best skills".smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
Sign In or Register to comment.