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.

MSP430FR5972: Low Power Mode 4.5

Part Number: MSP430FR5972

Hi,

When I am running example code separate it is working properly, but when I put the same code in my project after few(30-40 sec) sec automatically comes out from LPM4.5.

I am sending my code below. Please suggest me  what to do

void LPM4_5(void)
{
          uart_putstring("\r\n> >>>>>>In LPM 4.5 Mode<<<<<<<\r\n ");

// Configure GPIO
P1OUT &= ~BIT6;
P1DIR = BIT6;

// Determine whether we are coming out of an LPMx.5 or a regular RESET.
if (SYSRSTIV == SYSRSTIV_LPM5WU) {
PJSEL0 = BIT4 | BIT5; // For XT1

// Clock System Setup
CSCTL0_H = CSKEY >> 8; // Unlock CS registers
CSCTL1 = DCOFSEL_0; // Set DCO to 1MHz
CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK;
CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers
CSCTL4 &= ~LFXTOFF;

PM5CTL0 &= ~LOCKLPM5;

do {
CSCTL5 &= ~LFXTOFFG; // Clear XT1 fault flag
SFRIFG1 &= ~OFIFG;
} while (SFRIFG1 & OFIFG); // Test oscillator fault flag
}
else {
// Configure P1.6 as an Interrupt
P1OUT &= ~BIT6; // Pull-down resistor on P1.6
P1REN |= BIT6; // Select pull-down mode for P1.6
P1DIR = 0xFF ^ BIT6; // Set all but P1.1 to output direction
P1IES &= ~BIT6; // P1.6 Lo/Hi edge
P1IFG = 0; // Clear all P1 interrupt flags
P1IE |= BIT6; // P1.6 interrupt enabled

// Disable the GPIO power-on default high-impedance mode to activate
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;

PMMCTL0_H = PMMPW_H; // Open PMM Registers for write
PMMCTL0_L |= PMMREGOFF; // and set PMMREGOFF
PMMCTL0_H = 0; // Lock PMM Registers

// Enter LPM4 Note that this operation does not return. The LPM4.5
// will exit through a RESET event, resulting in a re-start
// of the code.
__bis_SR_register(LPM4_bits);

while (1); // MCU will wait here until the interrupt receive on P1.6
}

}

  • Is there any interrupts used?
    Is there any place in the code where the device is taken out of LPM?
    Have you disabled the Watchdog timer?

    Please verify these and if the issue persists please post the rest of your code so I can see if there is any issue in other places causing a reset.
  • Hi Nima,

    In my project I am using UART, RTC, ADC interrupt and only one LPM 4.5 which not exited any where in my project
    and I desabled watchdog timer in very first line.

    So suggest somthing else please I am waiting for positive reply
  • I would suggest you, to place this code in your project and disable the UART, RTC and ADC interrupts. If this is working try to enable each module step by step and check when this behavior occurs. Afterwards, we can check why this module is generating an interrupt.

    Best regards,
    Tobias

  • Hi Tobias,

    When I disable RTC, LPM 4.5 working properlly but still I face one issue when I gave a signal to wake up from LPM 4.5, it is not started from the next line after LPM, it started from main ()
    and I checked cause of reset it gives cause that exit from LPMx.5 (receive value 8 in SYSRSTIV register)
    mease when I gave a signal to wake up from LPM it is reseted.
    So kindly suggest what to do .....
  • Hi,
    good that you identified now the RTC for the unexpected interrupt.

    About your second question about the LPM x.5 entry point, that is expected. A LPMx.5 (LPM3.5 or LPM4.5) wakeup event generates a brownout reset (BOR), so programm execution starts from your main. Please note that when LPMx.5 is entered, the voltage regulator of the Power Management Module (PMM) is disabled. All RAM and register contents are lost. Although the I/O register contents are lost, the
    I/O pin states are locked upon LPMx.5 entry. Thats why a BOR is necessary.

    Best regards,
    Tobias
  • Thanks Tobias.
    Thare are two things,
    first I found the resion is RTC but I have to use RTC in my project so please let me know what I need do that both should work properlly
    and second I wanted that if I give wakeup signal than it should be continue just after LMP4.5 rather than start from main. So what I need to write in my program?
  • You need to check the RTC configuration, you can run RTC without interrupt generation. But RTC is not available in LPM4.5, just in LPM3.5. If you need to continue at the line after LPM entry I would propose you to use LPM3. LPMx.5 is always starting at main since all your register settings are lost, as I mentioned earlier and you need to handle this in your code.

    Tobias

**Attention** This is a public forum