cancel
Showing results for 
Search instead for 
Did you mean: 

How to save data in loss of power supply?

Arman Ilmak
Senior
Posted on May 15, 2018 at 22:34

Hi.

I was trying to end my project but I faced a problem.

In my project, the user enters a number named IDEAL_TEMPERATURE. But I need that his data won't get lost when the power supply is suddenly interrupted for some minutes or hours. Or when the watch dog timer (or any kind of reset) resets the MCU.

Which part of the reference manual should I look for this?

2 REPLIES 2
henry.dick
Senior II
Posted on May 15, 2018 at 22:51

1. Detect a power loss. Power losses are often a process so brown out detection is a good starting point 

2. Save data to non volatile memory once a power loss is detected.

In the rare event that sudden power loss is not detectable, write critical data to long-endurance non volatile memory.

Posted on May 15, 2018 at 23:37

Write it to EEPROM, FLASH or NVRAM (BATTERY BACKED) after the enter the value

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..