Shop OBEX P1 Docs P2 Docs Learn Events
What command is used to remove data from EEprom at certain locations only? — Parallax Forums

What command is used to remove data from EEprom at certain locations only?

orendaclorendacl Posts: 44
edited 2010-05-13 23:50 in BASIC Stamp
On a·BS2, if you took a look at a memory map and you see that the·memory map looks like:

......· 0· 1·· 2· 3·· 4··5·· 6·· 7·· 8·· 9· A·· B· C·· D· E· ·F
000 32 32 32·30 44 39 36 34·43 46· 36 ·44 32 39·32 32
010 30 32 34 43 FF FF FF FF FF FF FF FF FF FF

Is there a way in a·program·that·you can·tell the BS2 to dump·EEprom memory ONLY at certain locations?
If so, what command (or seuence of) is it?
Note:
The two above are·an array each made of up 10.
Say you just want to delete the 2nd array, so that you can (at option)·re-use it for a later time.·Note:
The is msut be done without a pc. That is,·say your bs2 is already in a permanent enclosure and you are unable to remove it·and do not have luxury·of placing it in a carrier board.
What command works for this?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-05-12 13:44
    Read the Manual chapters on the READ and WRITE statements. These are used to access the EEPROM for reading or writing from within a program.

    The Stamp Basic Syntax and Reference Manual can be downloaded from Parallax and is included in the help files of the Stamp Editor.
  • FranklinFranklin Posts: 4,747
    edited 2010-05-12 16:22
    orendacl, you need to go and delete your duplicate post using the red X in the upper right before someone posts to it. Double posting is not good form here. Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • orendaclorendacl Posts: 44
    edited 2010-05-12 20:58
    Hello, this is not a duplicate post. Although· it is similar to my other one let me explain what it is I am trying to do here and how it is different.

    The other post is in regards to adding information to eeprom and how to ensure it gets placed at a specific location.

    This post has nothing to do with that. The purpose of this post is to show a memory map. The idea that you could then delete the contents at my command...whether it be a button press, etc. I jsut do not know what command is actually used to delete contents of eeprom at specific addresses.
    Does that clarify it?
    If we were to look at the memory map I posted for each of the two forum posts, we would see that they are totally different!

    In future, I will try to make them look different.
    BTW these were not the same although the answer provided by one person was!
    They said·look at read write - thanks!
  • Mike GreenMike Green Posts: 23,101
    edited 2010-05-12 21:11
    To clarify details ...

    EEPROM is initially (when manufactured) all one bits ($FF). When new programs are downloaded, any areas not used by the new program (including DATA areas) are left alone. I believe the granularity for this is 16 bytes, but I could be wrong. You can get into trouble by assuming that the EEPROM is still $FF where not used because previous uses of the EEPROM may leave areas that are not $FF. It's safest to have a 2nd program that just initializes the EEPROM (not used by the program) to some initial state. A practical way to do this would be to have a special byte value (like $FF) that marks the end of the existing data table. Every time you add to the data table, you write a new $FF at the end of it. That way, you don't need to rewrite the whole EEPROM if you want to reinitialize it. You just need to write a $FF at location zero.

    Do remember that the memory map does not indicate what's actually stored in the EEPROM. It simply shows what is produced by compiling the program. Anything else that's already stored in the EEPROM will not show up on the memory map.
  • JDJD Posts: 570
    edited 2010-05-13 23:50
    Gents,

    · There is a little trick that you can use to view what is in·EEPROM from the memory map; if you make a routine that reads the EEPROM in the program than the memory map will show what is in the EEPROM. Here is a small illustration and sample code if you would like to use or review it.

    I hope this helps



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
Sign In or Register to comment.