Memory Storage Management v1.3 question
stef
Posts: 173
Hi
I'm using this object to store some values in one of my projects. It is working fine but after I reprogram with F11 all my values are gone.
I saw in the notes that it is possible.
'' Using a 64KB EEPROM and setting the start addresses (in CON) into the unused
'' section of the EEPROM will allow the values to stay even after an F11
'' reprogramming.
I use an eeprom 24lc512
This are the settings in the program now.
CON
{{== ALL start_* constants must be an address at the beginning of a block ==}}
{{== Use supplied Excel file to help calculate these values. ==}}
block_size = 64 ' size of EEPROM sectors (blocks) -- all values in comments below assume 64-byte block size -- this value cannot excede EEPROM block size, but could be a smaller miltiple of actual block size: 32, 16, or 8
store_info = $71E0 ' table - 32
start_table = $7200 ' must start at beginning of a block
start_names = $7600 ' table + 512 (64 table entries), must be at least the length of a single block
start_data = $7E00 ' names + 1024 (minimum 64 names -- and leaves space for 4096 bytes of values), must start at beginning of a block
end_data = $7FFF ' end of data table, must end at end of a block
table_size = 256 ' must be equal (in longs) to the space between start_table and start_names (default is 128 == 512 bytes), must be an exponential value of 2 (32, 64, 128, 256, etc.)
name_size = 16 ' maximum name length (keep LESS THAN block_size)
BootPin = 28 ' I2C Boot EEPROM SCL Pin
EEPROM = $A0 ' I2C EEPROM Device Address
What do I need to change and to witch value? And how do you get to those values?
Thanks in advance for any reacktion.
Stef
I'm using this object to store some values in one of my projects. It is working fine but after I reprogram with F11 all my values are gone.
I saw in the notes that it is possible.
'' Using a 64KB EEPROM and setting the start addresses (in CON) into the unused
'' section of the EEPROM will allow the values to stay even after an F11
'' reprogramming.
I use an eeprom 24lc512
This are the settings in the program now.
CON
{{== ALL start_* constants must be an address at the beginning of a block ==}}
{{== Use supplied Excel file to help calculate these values. ==}}
block_size = 64 ' size of EEPROM sectors (blocks) -- all values in comments below assume 64-byte block size -- this value cannot excede EEPROM block size, but could be a smaller miltiple of actual block size: 32, 16, or 8
store_info = $71E0 ' table - 32
start_table = $7200 ' must start at beginning of a block
start_names = $7600 ' table + 512 (64 table entries), must be at least the length of a single block
start_data = $7E00 ' names + 1024 (minimum 64 names -- and leaves space for 4096 bytes of values), must start at beginning of a block
end_data = $7FFF ' end of data table, must end at end of a block
table_size = 256 ' must be equal (in longs) to the space between start_table and start_names (default is 128 == 512 bytes), must be an exponential value of 2 (32, 64, 128, 256, etc.)
name_size = 16 ' maximum name length (keep LESS THAN block_size)
BootPin = 28 ' I2C Boot EEPROM SCL Pin
EEPROM = $A0 ' I2C EEPROM Device Address
What do I need to change and to witch value? And how do you get to those values?
Thanks in advance for any reacktion.
Stef
Comments
There is also a note: "Use supplied Excel file to help calculate these values." It is very helpful for calculating the needed values.
If you use the first block in the Excel file ("Calculate Values for Known End Position"), enter in a new "end_table" value, which can be an address anywhere in the upper 32K of your EEPROM ($8000 - $FFFF). If you want to put it at the top of the upper 32K, you enter in FFFF for the end_table, and you get these values:
I would also suggest updating the object. The newer version (2.0.2) has some performance improvements and many added features.
Note that if you do update the object, I think starting at v.2.0.0 the constant "block_size" is now "page_size".
Hope some of this helps. Let me know.
Download the newest version of the Excel spreadsheet (not available in the object files) here: www.nimonpro.com/MemoryStorageValueCalculator.xls
It adds a nice feature to be able to just copy/paste the constants into your object CON section and adds another "calculate for" block for a known beginning and end address.
Thanks for the clarification. I'll try this out. I saw over the exel file
I can tell you that your object is working like a charm and I already used it in differend project. I 'm now creating a hot tube steering (Because the original one is broke and it is an old one so you can't find any spare parts.) It has an up and download future over tcp/ip but I was a bit frustrated that I alwayse lost my setting after a download. I change my code today and give it a try.
Thanks in advance.
Stef