Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:46 11 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Variable save space

Author Message
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2171
Posted: 08:13pm 01 Feb 2018
Copy link to clipboard 
Print this post

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.

Edited by CaptainBoing 2018-02-03
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9750
Posted: 11:09pm 01 Feb 2018
Copy link to clipboard 
Print this post

[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: Australia
Posts: 3308
Posted: 04:30am 02 Feb 2018
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 2171
Posted: 07:35am 02 Feb 2018
Copy link to clipboard 
Print this post

  Geoffg said   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


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
Edited by CaptainBoing 2018-02-03
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2171
Posted: 07:41am 02 Feb 2018
Copy link to clipboard 
Print this post

  Grogster said   [Quote]... could use ... UNIO ...[/Quote]

Are you aware of the external.......dammit!



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!!! Edited by CaptainBoing 2018-02-03
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 12:26pm 02 Feb 2018
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 2171
Posted: 02:38pm 04 Apr 2018
Copy link to clipboard 
Print this post

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
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025