Hi,
Could anyone help me with how to store variables to EEPROM, to be less sensitive for lost power supply.
And after wake-up I want to restore variables from the same memory.
I'm using Flowcode 7 and a standard 8bit PIC MIAC.
Thanks
Claes Ostberg
MIAC how to save and retrieve variables from EEPROM
- 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: MIAC how to save and retrieve variables from EEPROM
Hello Claes,
Should be as easy as doing the following.
At the start of your program use the EEPROM read function to pull values from the EEPROM and save into your variables.
Then in your program when you write to a variable you can also write to the EEPROM location.
Beware though because the EEPROM erase/write limit is usually in the 100,000 range so if you change the value just once every second then you will potentially burn out the EEPROM location after 1.15 days.
Should be as easy as doing the following.
At the start of your program use the EEPROM read function to pull values from the EEPROM and save into your variables.
Then in your program when you write to a variable you can also write to the EEPROM location.
Beware though because the EEPROM erase/write limit is usually in the 100,000 range so if you change the value just once every second then you will potentially burn out the EEPROM location after 1.15 days.
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: MIAC how to save and retrieve variables from EEPROM
Thanks Ben,
Sorry but I am a newbie to this. I have tried to find the EEPROM function among MIAC Component macros, but without any luck.
Shall I include a c-code line in Flowcode, and in that case could you tell me the syntax?
Is there a list of all functions available in flowcode for the MIAC hardware?
Best Regards
Claes
Sorry but I am a newbie to this. I have tried to find the EEPROM function among MIAC Component macros, but without any luck.
Shall I include a c-code line in Flowcode, and in that case could you tell me the syntax?
Is there a list of all functions available in flowcode for the MIAC hardware?
Best Regards
Claes