Variable on Eeprom
UlrichBode
Posts: 2
in Propeller 1
Hello,
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
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
Comments
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
Cheers!
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
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:
@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...
Mike