Writing data to EEPROM



  • kuronekokuroneko Posts: 3,623
    edited 2011-11-22 - 05:34:03
    JBWolf wrote: »
    How much of a delay should I have after a VarBackup or VarRestore command before using again?
    Up to you. AFAICS there is no specific limit.

    One last thing, I'd suggest you defer resetting databackup until after the VarBackup call returns. Then guard your button conditions with something like
    if ina[button1] and not databackup
    This avoids changes to the data while its being backed up (see note in post #28).
  • JBWolfJBWolf Posts: 334
    edited 2011-11-22 - 07:18:34
    Ah I get ya, good thinking... I put in more delays than necessary to avoid just that.
    So I do not need any delay between writing variables?
    I could have two VarBackup calls back to back without any delay?

    I have already finished adding the eeprom backup to my actual program, works great!
    I figured out how to backup data nested 2+ cogs deep... so far I have accomplished everything I was hoping to :)
  • kuronekokuroneko Posts: 3,623
    edited 2011-11-22 - 16:06:48
    Yes, any number of VarBackup calls is possible without delay (additionally, the guard I suggested should probably only be around the actual backup call so that you at least update your variable during a button press). Note, the example you posted only does a backup in the context of a single cog. Once you start backing up from more than one cog you have to synchronise them somehow. I'm sure you'll figure it out, it's all in this thread.
  • lardomlardom Posts: 1,556
    edited 2011-11-22 - 16:24:18
    Kuroneko, excellent. BTW today I learned how to use bytefill from one of your posts from February this year so I'll say thanks twice in this thread.

    If the grass is greener on the other side...it's time to water your lawn.
  • Duane Degn wrote: »
    Mike Green wrote: »
    Most Propeller boards only provide the pull-up resistor on the SDA line.


    I disagree. I think the norm is for Propeller boards to use pull-ups on both the data and clock lines. I recently looked through some of my Propeller boards to note which boards use a pull-up on the clock and which don't.

    I found three boards without pull-ups on both lines.

    The Propeller Professional Development board
    Propeller Demo Board
    Jazzed's TetraProp board (He says leaving off the clock pull-up was an oversight.)

    These are the boards with pull-ups on both lines.

    Propeller Protoboards
    QuickStart boards
    GG Propeller Platform
    Laser Range Finder
    Propeller Backpack
    Tubular's UN3RB3LLY

    Kye's real time clock object assumes there are pull-ups on both lines.


    Just to add to this list, Propeller Mini doesn't have clock pull-up on I2C line.

    I wasn't careful enough, some I2C drivers floating on this forum assuming pull-up on the clock line. These won't work with Propeller Mini.

    The "Basic_I2C_Driver.spin" does work.

    Basically it's how to drive the clock line high, either by releasing it (assuming pull-up) or writing "1" to the pin.

  • FYI, prior to this last post this thread was over 7 years old.
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
Sign In or Register to comment.