Go Down

Topic: Saving and loading csv/txt file in EEPROM (Read 309 times) previous topic - next topic

playgamemy

Allow me to explain my situation a bit, and since I have only starting learning Arduino and programming in general, let me know if I got something wrong.

I am designing a kiln controller, which will allow user to programme a "firing profile", where a profile will have a "profile name". In a profile there are multiple "steps", each step has three values - "rate", "temperature", and "incubation time", which will be loaded by the programme to control the kiln firing process to match the profile steps probably, one step at a time.

in order to save these profile, I intend to use the internal EEPROM. In my understanding, by using the EEPROM library directly, I will need to predefine the starting address for each profile, and therefore maximum length of the profile name and steps, so I can look for the stored values afterward.

Now it works, but greatly limit the number of profile I can save, consider I need to accommodate for the possibility that some profiles may need up to 20 steps with 20 characters name, most profiles may only have 3 or 4 steps with 8 characters name.

It will be great if I can have a separate file (e.g. CSV/TXT) saved for each profile (and number as the file name), with profile name stored in first row, and steps in subsequent rows consist of 3 columns. So I can load the file and put it into array for the firing process. In which case the file will only be as large as the profile require, instead of a chunk 100 byte in size for even the smallest profile with 1 step.

So my question is:

1. Is my concept right? Does using a csv/txt file format save me memory usage, or will it use more due to the overhead due to the file format? I cannot find such information on the web (probably 'overhead' is not the right term).

2. I believe I need some sort of file system to manage the saving and loading of files, are there library for such purpose? And again, will it use up a lot of the EEPROM memory just to implement such file system?

3.If such solution already exist for the internal EEPROM, will it be a lot harder to implement for an external EEPROM?

Thanks in advance

PaulS

Quote
1. Is my concept right? Does using a csv/txt file format save me memory usage, or will it use more due to the overhead due to the file format? I cannot find such information on the web (probably 'overhead' is not the right term).
Where are you going to save this file? You can save data in EEPROM. You can not save files in EEPROM.

Quote
2. I believe I need some sort of file system to manage the saving and loading of files, are there library for such purpose? And again, will it use up a lot of the EEPROM memory just to implement such file system?
There are no libraries that I am aware of that manage saving files in EEPROM. That is not where files are meant to be stored.

Quote
3.If such solution already exist for the internal EEPROM, will it be a lot harder to implement for an external EEPROM?
Internal vs. external doesn't mean a lot. Reading and writing to EEPROM happens one byte at a time. There is a library for writing to the internal EEPROM. There are libraries for writing to external EEPROM. There is a different function, but the data that the function needs is pretty much the same - what data to save and where to save it.
The art of getting good answers lies in asking good questions.

playgamemy

In case filesystem is not viable way, any suggestion on how I could organise so I can accommodate possibility that some profiles may have lots of steps and therefore large in size, while most of the expected profiles will be relatively simple and small. Such I can fit more profiles into the limited space of the EEPROM?

PaulS

If you put a value of 17 in address 0, followed by some characters in subsequent addresses, could you hazard a guess as to the address where the next numeric value would need to be stored?

If you were reading, and wanted to find the third profile, could you hazard a guess as to where to read first? Second? Third?
The art of getting good answers lies in asking good questions.

Go Up