from Ram to Eeprom
Daimon
Posts: 2
hi there
well, I'm working with a Basic Stamp 2 sx (BS2sx) and an ADC 16-bits. I have a problem.
I'd like to transfer the data stored in the ram from the ADC (shiftin) to the EEPROM.
The program is like this:
value VAR Word
Shiftin data,... [noparse][[/noparse]value\17]
I'd like to transfer the "value" word from the Ram to the EEPROM location for example 0.
Does someone know which syntaxe is necessary to do that?
Thanks in advance
Daimon
well, I'm working with a Basic Stamp 2 sx (BS2sx) and an ADC 16-bits. I have a problem.
I'd like to transfer the data stored in the ram from the ADC (shiftin) to the EEPROM.
The program is like this:
value VAR Word
Shiftin data,... [noparse][[/noparse]value\17]
I'd like to transfer the "value" word from the Ram to the EEPROM location for example 0.
Does someone know which syntaxe is necessary to do that?
Thanks in advance
Daimon
Comments
thanks for answering. Read and write are the syntaxes I tried but I didn't understood why I couldn't see it in the memory map (stamp editor). If I correctly read the manual, variables in the memory aren't shown, even if you put a direct variable in it.
But thanks for the response.
So, if you specify a 'DATA' statement, that data should show up in the "memory map". If you merely specify an address in your code that you're going to WRITE to, well, the IDE doesn't know about that, and so doesn't put that in the "memory map".
I suggest that you use the DATA statement (with a label on it) to define the area(s) in EEPROM that you're going to use. It helps insure that these areas are at the beginning of the EEPROM (the program is at the upper end).
Be careful how you use the WRITE statement since you can "wear out" an EEPROM location with excessive (more than about 100,000) writes. In a program where this is done in a loop, you can wear out a location in a couple of hours. The best way to avoid this is to compare the current content of the location with the variable you want to store. If they're already equal, don't do the WRITE like:
This obviously won't help you if the value is constantly changing.