Variable on Eeprom

I need your help for my new project. Please excuse my bad English,I use Google translator.
So far, I have successfully programmed Atmel AVR. The Atmel chip has an Eeprom I once with
Variables then describe (TxT file) the then stay saved. When starting the program
they are then read and then serve to Course of the program.
Now it wants to do it with the propeller and spin.
But a propeller has no Eeprom but only the Memory chip.
Here is my problem: How do I do that with the Propeller.

Gruss Ulrich


  • The Propeller loads its software into internal RAM from an external I2C EEPROM chip so you can always talk to the EEPROM over I2C. If your Spin program has variables then it is a simple matter of writing to EEPROM using the "address of the variable in RAM" since the variable is part of the binary image loaded from EEPROM on reset. This means that variables will be automatically "preset" on power-up etc with the last information that was written to EEPROM rather than zeros or blanks.

    When a new program is loaded into EEPROM the loader automatically erases the first 32kB but most EEPROMs are 64kB so you can safely store text and files in the upper half that are not erased when a new program is loaded.

    With a little bit more information about your application and what language you are using we should be able to make that answer a little clearer :)


    Tachyon Forth - compact, fast, forthwright and interactive
    --->CLICK THE LOGO for more links<---
    P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    Brisbane, Australia
  • Hi Peter,
    Thank you for the fast answer.
    The application is a telescope control. The two directions,
    vertical and horizontal, I've ever programmed in an extra cog (with spin).
    And as you described it with the Eeprom, I also imagined it.
    Attached is a configuration file that is loaded into the Eeprom when needed and
    Always stays in it. From left to right, the first 6 digits are the name of each line
    Variable and last 4 digits the contents of the variable. These variables must be in the
    Starting the controller are loaded, they are telescope-dependent.
    I hope this helps you further,

    Thank you, Ulrich
  • msrobotsmsrobots Posts: 2,394
    edited 2018-02-08 - 19:03:07
    Hallo Ulrich,

    willkommen im Propeller Forum!

    wie Peter schon geschrieben hat, ist es ganz einfach Konfigurations-Parameter zurueckzuschreiben.

    Beim Start laed der Propeller die ersten 32K vom EEPROM ins RAM. Das praktische daran ist das die adressen dieselben bleiben.

    Also wenn das SPIN program eine globale variable in der DAT section hat, wird diese beim START aus dem EEPROM geladen. Wenn du nun einen neuen wert dort speichen moechtest, der beim naechsten start verfuegbar sein soll, musst du nur im EEPROM genau diesen wert ueberschreiben.

    Die EEPROM adresse ist dieselbe wie die RAM adresse.

    In der OBEX findest du unter anderem folgendes EEPROM modul Generic I2C EEPROM Driver

    Ein Beispiel:
    eeprom: "I2C_ROMEngine.spin"
    RaFein long 5
    RaGene long 239
    PUB saveSetting(newFein,newGene)

    @RaFein gibt in SPIN die Adresse der Variable RaFein im HUB-RAM, und diese Adresse muss dann im EEPROM ueberchrieben werden.

    viel spass mit dem propeller...

    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
Sign In or Register to comment.