I am using a BS2 and I am running out of variable·space, what are the possibilities of storing some variables on EEPROM using read and write commands. Regards Hank van Buuren
It's certainly possible. The more important question is whether you have already made the most effective use of the variable space available. It's very common for people to use more space for variables than they need. For example, if you only have two values, you can use a single bit. If you have 16 or fewer values, you can use a 4-bit nibble. Can different parts of your program share the same variable space?
The most important part of the use of EEPROM for data is that you can only write to a given location about 100,000 times before it begins to "wear out" and that's easy to do in a program in a matter of hours or days. Also, it takes about 5ms to write to a location in EEPROM. Reading is fairly quick. You don't want to keep frequently changed information in EEPROM for these reasons.
You can't use an EEPROM to create space for extra variables, if you're figuring to expand the "RAM Map".· External EEPROMs are for storing/retrieving data.
Post Edit -- The subroutines for I2C "bit-banging" (which you'll have to do with anything other than a BS2p-type stamp) take up a lot of "code space", too.
Comments
The most important part of the use of EEPROM for data is that you can only write to a given location about 100,000 times before it begins to "wear out" and that's easy to do in a program in a matter of hours or days. Also, it takes about 5ms to write to a location in EEPROM. Reading is fairly quick. You don't want to keep frequently changed information in EEPROM for these reasons.
Post Edit -- The subroutines for I2C "bit-banging" (which you'll have to do with anything other than a BS2p-type stamp) take up a lot of "code space", too.
Post Edited (PJ Allen) : 7/28/2008 7:32:05 PM GMT
So, you shouldn't write to them very often. Once a second is okay, once a milli-second will wear them out pretty quickly.
And you can't use eeprom locations for a variable the way you can use "RAM" space (of which you have 26 bytes or 13 words).