View Full Version : Renaming Variables

Lucas Harlem
01-10-2006, 10:35 AM
In response to my last post about EEPROM, I have a way around using it, but these variables are not responding.

MM Var Byte 'Current Month Variable
LM Var Byte 'Previous Month Variable

SEROUT 0\1, 16468, [M7]
LM = MM 'I need to copy the value stored in Variable MM into the Variable LM but not make them equal to each other.
MM = 0 'I need to clear this variable without changing the previous value that is stored in LM.
GOTO start 'I am aware that this says to go to start, and not month, it is correct, it does not goto month.

When the stamp is reset, not powered off, just rest, are variables lost?

I am trying to avoid using EEPROM, is this possible in this scenario, because when I run the program the variables are not copying.

I did look at the alternatives to using the stamps EEPROM posted by other members in the previous post, and they were very helpful, I would rather use external eeprom rather than the stamps eeprom.


L. Harlem

Bruce Bates
01-10-2006, 01:36 PM
Lucas -

You must write the variables which you want to save through a reset to EEPROM. All memory, and all variables are cleared when the program is loaded, and this is the condition upon restart (reset).


Bruce Bates

kelvin james
01-10-2006, 02:08 PM
i'm not sure what you are trying to do with your program, hard to tell from a small part of it. From your other post, you have a bs2p40, so you have some other alternatives with ram, like scratchpad use. You can us this to temporarily store variable values that can be retrieved anytime using the GET and PUT commands. The i2c external eeproms are easy to wire and use, i have 4 ( 24c65p ) hooked up on a small bus. And since your p40 can use the i2c commands, the coding is simple. Just another option to look at.


01-10-2006, 05:12 PM
I've found after fumbling around with problems myself and asking for help that it is more helpful to be complete with your code listing and explanation of what you want to do?

What is the reason you don't want to use the stamps eeprom?

Values like month and previous month should be able to be calculated at any time if you store the months names (if thats how you want to recognise them)in an array. The index could also be used as an identifier. eg 1 Jan 2 Feb 3 Mar etc..

As those names are more than one value i.e. three letters perhaps it would be necesary ·to multidimension the array. If that is possible with the stamp?

Then current month could be the current index value and previous month would be current index - 1.·Just read the string then for the name.

I am new to this and my suggestion may of be no help but I feel like I should try and give something back as I have received help here myself from kind people.