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.

Wakup from LPM4.5 and LMP3.5 (MSP430FR6872)

Hello,

My code needs to sometimes waking up from LPM4.5(via I/O pin interrupt) and sometime from LPM3.5(via RTC interrupt)

In the past when I had only one low power mode, my main always used the " if (SYSRSTIV == SYSRSTIV_LPM5WU) " check to see if I am coming from low power mode in order to execute specific tasks if true.

However, now that I need to wakeup from either LPM4.5 or LMP3.5 mode, I am not sure how to check and differentiate in my main, wether I am coming from LPM4.5 or LMP3.5.

Any help is truly appreciated.

Thank you,

Admir

  • Hello Admir,

    Would it be possible to create a FRAM variable that is set before entering the LPMx.5 and indicates which LPMx.5 was in operation before waking up? Another option is to use the CTPL as part of the FRAM Utilities library to restore the saved state and return to the main application like a regular LPM: www.ti.com/.../msp-fram-utilities

    Regards,
    Ryan
  • Hi Ryan,

    Since I have to save my RAM variables into FRAM anyway, I could like you said create an extra flag that tells me from which LPM I came from upon reset.

    Thank you for making me aware of the FRAM utilities existence. So if understand this correctly, using the CTPL enables me to treat the LPM modes like an interrupt in a way(with the exception I have to save all of my RAM variables into FRAM before entering the LPM modes):
    my main will "service" the "ctpl_enterLpm35()" function call:( save the flags into FRAM, return to main and go on with the next line of the code where it stopped) and all that without a need to re-init the GPIOs?

    Thank you for your kind response.

    Admir

  • Hi Admir,

    I think you understand the basic idea behind CTPL, it saves the state of the MCU so that it can re-start where it left off before going into LPMx.5. This avoids having to re-initialize all of the peripherals and get back to the desired location inside of the main code.

    Regards,
    Ryan
  • Hi Ryan,

    I will implement the CTPL functionality as it simplifies my main.

    Thank you for confirming my understanding and for all of your time. :)

    admir

**Attention** This is a public forum