|
Forum Index : Microcontroller and PC projects : Variable save space
| Author | Message | ||||
| CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2171 |
There is only 2K available for variable storage in FLASH. What are the possiblities/restrictions in increasing this - maybe something like OPTION VAR SAVE 8 or similar making it the number of kilobytes required. 2K is a bit weedy and I have loads of flash left in this one project but a need to capture enduring logs: > memory Flash: 9K (15%) Program (397 lines) 2K ( 2%) 1 Saved Variable (1842 bytes) 49K (83%) Free RAM: 4K ( 8%) 19 Variables 0K ( 0%) General 46K (92%) Free The stored variable is a string array 141 elements by 12 chars using a highly compressed logging form. At about 40-50 entries per day this only gives me about 3 days log space - ideally I could do with 8 (one week and a day) so if it was possible to change the variable flash it would eat into the 83% free space without a problem. OPTION VAR SAVE 12 would be the 12K I could do with. that would be nice. I know I could use one of the many storage options (UNIO etc) but that isn't the point here. I am trying to keep component count and program complexity to a minimum. I have loads of flash I can't use. |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9750 |
[Quote]I know I could use one of the many storage options (UNIO etc) but that isn't the point here. I am trying to keep component count and program complexity to a minimum. I have loads of flash I can't use.[/Quote] Are you aware of the external.......dammit! OK, joking aside, this is not a bad idea. it MIGHT be something that can indeed be done. I would see that as a useful change for those that would want extra space, but I guess it is up to Geoff. I will be watching this thread to see if Geoff or Peter reply. ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3308 |
The way flash is allocated makes it difficult to change the size with an option however I will investigate. A quick calculation shows that if you save 40-50 entries per day you will wear out the flash in under two years. A tiny UNI/O Serial EEPROM would last 100 years - I wrote the UNI/O driver for exactly this reason. Geoff Geoff Graham - http://geoffg.net |
||||
| CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2171 |
Thanks for looking Geoff. If nothing comes of it I am no further back but it would be great to be able to have such a feature for small lumps The log isn't saved each time I write to it. It's a normal string array which is VAR SAVEd only at key moments: Startup - preserve a record of the start time and indicate if it was coz of a watchdog event. Dawn - dump the night's data Dusk - dump the day's data I am going to accept the risk of losing the data in between in the case of a restart for the sake of not wearing out the FLASH - worst case is 12+ hours. So I am only aging FLASH out twice a day which should give me 10,000 days... doubt if I've got that long left - ! wait a moment...> ? DateAdd(10000,"dd",now()) 20-06-2045 07:30:38 > hmmm.... might just be a problem after all |
||||
| CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2171 |
You little scamp Grogs! What I am trying to do is retro-fit an exitsing project that it tucked away and was a right cow to assemble due to space. If I could get a few K extra with a clever firmware update it saves the world from 2 hours of vile cursing I could really use something like this in other places - I've held off with enduring logs on other projects due to the space constraints - and to be honest, the logs weren't vital there but I do love a log!!! |
||||
| viscomjim Guru Joined: 08/01/2014 Location: United StatesPosts: 925 |
I second this request. Having the ability to use more of the flash for variable storage, especially on the 28 pin, would be just great. Please, pretty please, consider this. I am aware of the limitation of wearing out the flash, but writing only occasionally, this wouldn't be a big problem if one is aware. |
||||
| CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2171 |
compact logging to the 2K flash space http://fruitoftheshed.com/MMBasic.Ultra-Compact-Logging-with-Flash-Storage-on-small-MicroMites.ashx?NoRedirect=1&NS=MMBa sic |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |