Skip to main content
Visitor II
May 15, 2018
Question

How to save data in loss of power supply?

  • May 15, 2018
  • 2 replies
  • 824 views
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?

    This topic has been closed for replies.

    2 replies

    Visitor II
    May 15, 2018
    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.

    Graduate II
    May 15, 2018
    Posted on May 15, 2018 at 23:37

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