Hi all, anyone can tell me how I can know how much I have eeprom memory free.
Thanks
As eeprom know how many positions are left.
Moderator: Benj
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: As eeprom know how many positions are left.
Hello pibepru.
When you use the EEprom Component that should state how many bytes you have in total e.g 64 Bytes. I believe It does not work like ram or rom, since you need to state the address and byte. So only you can determine how how many bytes are left. E.g if writing a loop that is accessed 4 times and each time address 0 to 3 is assigned with a value then you know 64-4 bytes are left. I don't think the information is given on compiling since the eeprom is only accessed during running of code, therefore can't be a fixed allocated amount (like ram and rom). Hope I have made that clear,and I have got that right
When you use the EEprom Component that should state how many bytes you have in total e.g 64 Bytes. I believe It does not work like ram or rom, since you need to state the address and byte. So only you can determine how how many bytes are left. E.g if writing a loop that is accessed 4 times and each time address 0 to 3 is assigned with a value then you know 64-4 bytes are left. I don't think the information is given on compiling since the eeprom is only accessed during running of code, therefore can't be a fixed allocated amount (like ram and rom). Hope I have made that clear,and I have got that right

Martin
Re: As eeprom know how many positions are left.
Madeles35 Hello, my problem is knowing that I have used memory locations in the code and which are free to not repeat in the code that somehow there has Flowcode registration which are used and those not??
Thanks for your help.
Hola madeles35, mi problema es saber que posiciones de memoria he utilizado en el codigo y cuales estan libres para no repetir en el codigo existe alguna manera que Flowcode tenga el registro de las que estan usadas y las que no????
Gracias por tu ayuda.
Thanks for your help.
Hola madeles35, mi problema es saber que posiciones de memoria he utilizado en el codigo y cuales estan libres para no repetir en el codigo existe alguna manera que Flowcode tenga el registro de las que estan usadas y las que no????
Gracias por tu ayuda.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: As eeprom know how many positions are left.
Hello,
You could use free allocation. Eg create a routine that reads each byte of the EEPROM. You would need a value to signify that a byte of the EEPROM memory is empty. It makes sense to make this 255 as the EEPROM will all revert to 255 when it is erased.
Eg
idx = -1
data = 255
while (idx < 64) && (data = 255) - this is if you have 64 bytes of EEPROM
{
idx = idx + 1
data = EEPROM Read (idx)
}
The downside of this would be that you will have to remember the index positions for each and every location you are freely assigning. You could do this in an array but for most programs hardcoding the assignments will more then do the job.
You could use free allocation. Eg create a routine that reads each byte of the EEPROM. You would need a value to signify that a byte of the EEPROM memory is empty. It makes sense to make this 255 as the EEPROM will all revert to 255 when it is erased.
Eg
idx = -1
data = 255
while (idx < 64) && (data = 255) - this is if you have 64 bytes of EEPROM
{
idx = idx + 1
data = EEPROM Read (idx)
}
The downside of this would be that you will have to remember the index positions for each and every location you are freely assigning. You could do this in an array but for most programs hardcoding the assignments will more then do the job.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: As eeprom know how many positions are left.
Thank you very much for your help
Muchas gracias por vuestra ayuda.
Muchas gracias por vuestra ayuda.