This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430FR5994: Saving application and peripheral states before a power lost

Part Number: MSP430FR5994
Other Parts Discussed in Thread: MSP-FRAM-UTILITIES

Tool/software: Code Composer Studio

Hi,

I have been using the compute through power lost (ctpl) api provided by the TI Fram utilities example. This API saves the system stack and states and enters low power mode and allows the program to resume execution from where it saved even after a power lost. I'm not very interested in entering low power mode after I save, rather I want it to continue operating as normal after a save. So I have now modified the code to do so.

A problem that I ran into was during testing where I have a intermittent power system setup, sometimes the system would shut off in the middle of a save and won't be able to complete the save. This forces the system to start from the very beginning of the program the next time it power ups.

I'm wondering if there is a way for the api to save 2 different versions of the stack/states, the second one being the latest verison and the first one will be the previous version. This way if the system fails to save the latest version, it can then go back to the previous version upon start up and does not have to restart from the very beginning of the program anymore.

If anyone can point me in the right direction to do it would be very helpful, 

Thanks in advance and the api i used can be found here 

  • Have you though about providing a secondary power source?
    There are batteries (tiny ones that can be soldered to a PCB) that can be added at the VCC of the MCU that will keep charging as long as the primary power is supplied but will provide power when the primary source is disconnected.
    This will resolve your problem when saving data.
  • Thanks for the response.

    Of course if i continue providing it with power it won't fail.

    But I want this system to work under intermittent energy conditions where power failures can occur and occur frequenctly
  • Steven,

    What I meant was that the secondary power is only used to insure that data saving is not interrupted after a power failure is detected. The only way you can 100% guarantee data saving is not interrupted is by guaranteeing a power source that is there (for a moment) after a power failure. All that is left is how to detect a power failure and how to handle it when it happens. But now you are guaranteed that the MCU is actually running (for a moment) to make the proper decisions.
  • I understand what you mean but I can't just have another power source that provides power to ensure proper saving since this system will be tested for different energy harvesting systems. Failure to save is a possibilities that cannot and should not be manually prevented, rather the systems needs to be able to work even under those conditions
  • Hi Steven
    For the measure to increase the time for MCU to save the data you refer to the following solution
    1.add a big capacitor on the VCC near the MCU.
    2. Use the ECOMP or ADC to detect the VCC voltage(we have the code example in the CTPL's user's guide)

**Attention** This is a public forum