Shop OBEX P1 Docs P2 Docs Learn Events
lower addresses already written to — Parallax Forums

lower addresses already written to

qazxsw21000qazxsw21000 Posts: 13
edited 2011-11-17 18:12 in BASIC Stamp
I'm creating a project with LEDs and the RFID module. The project requires the use of EEPROM to store tag data. After some testing, I found that the lower addresses (0-15) are written to already. I only tested to 15. Why is this? If I set it the values to 0 before loading the actual program, will the values remain at 0, or will it reset to their defaults?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-11-17 17:42
    The compiled program gets loaded from the top of memory (2K) downwards. It's rare that the first few bytes of the EEPROM get changed unless a very big program has been loaded before or unless some other program has written them before. The default value for a byte in EEPROM is $FF, not $00. If you found some other values, they may have been written during testing of the Stamp or by some previous program of yours. They'll keep their most recent value for years until it's changed to something else (or a very large program overwrites the locations).
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-11-17 18:12
    Any program that was loaded which contains DATA statements will also place data in these locations as this is where data from those statements is stored. There is a command you can download to your BASIC Stamp which will write a specific value to a range of addresses to 'pre-set/clear' that memory if you're interested. The following code initializes the first 20 bytes of EEPROM to the value $00. I hope this helps.
    [FONT=Courier][SIZE=1][FONT=Courier][SIZE=1] DATA @0, 0 (20)
    [/SIZE][/FONT][/SIZE][/FONT]
    
Sign In or Register to comment.