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.

XMS432P401R REVC LPM3 current consumption exception

Other Parts Discussed in Thread: ENERGYTRACE

My configurations are as follows before MCU enters LPM3:

        MAP_I2C_disableModule(EUSCI_B0_BASE);
	MAP_I2C_disableModule(EUSCI_B1_BASE);
	MAP_I2C_disableModule(EUSCI_B2_BASE);
	MAP_I2C_disableModule(EUSCI_B3_BASE);
	MAP_UART_disableModule(EUSCI_A0_BASE);
	MAP_UART_disableModule(EUSCI_A1_BASE);
	MAP_UART_disableModule(EUSCI_A2_BASE);
	MAP_SPI_disableModule(EUSCI_A3_BASE);

	MAP_Timer_A_stopTimer(TIMER_A0_BASE);
	MAP_Timer_A_stopTimer(TIMER_A1_BASE);
	MAP_Timer_A_stopTimer(TIMER_A2_BASE);
	MAP_Timer_A_stopTimer(TIMER_A3_BASE);

	MAP_DMA_disableModule();

        MAP_SysTick_disableModule();

	MAP_ADC14_disableConversion();
	MAP_ADC14_disableSampleTimer();
        MAP_ADC14_disableModule();
PSS->KEY = PSS_KEY_VALUE; BITBAND_PERI(PSS->CTL0, PSS_CTL0_SVSMHOFF_OFS) = 1; PSS->KEY = 0; P1SEL0 = 0x00; P1SEL1 = 0x00; P1DIR = 0xFF; P1OUT = 0x00; P1IE = 0; P1IFG = 0; P2SEL0 = 0x00; P2SEL1 = 0x00; P2DIR = 0xFD; P2OUT = 0x00; P2IE = 0; P2IFG = 0; P3SEL0 = 0x00; P3SEL1 = 0x00; P3DIR = 0xFF; P3OUT = 0x00; P3IE = 0; P3IFG = 0; P4SEL0 = 0; P4SEL1 = 0; P4DIR = 0xFF; P4OUT = 0x00; P4IE = 0; P4IFG = 0; P5SEL0 = 0x00; P5SEL1 = 0x00; P5DIR = 0x37; P5OUT = 0x00; P5OUT |= BIT3; P5IE = 0; P5IFG = 0; P5IES |= BIT3; P6SEL0 = 0x00; P6SEL1 = 0x00; P6DIR = 0xFD; P6OUT = 0x00; P6IE = 0; P6IFG = 0; P7SEL0 = 0x00; P7SEL1 = 0x00; P7DIR = 0xFF; P7OUT = 0x00; P7IE = 0; P8SEL0 = 0x00; P8SEL1 = 0x00; P8DIR = 0xFF; P8OUT = 0x00; P8IE = 0; P9SEL0 = 0x00; P9SEL1 = 0x00; P9DIR = 0xFF; P9OUT = 0x00; P9IE = 0; P10SEL0 &= ~0x3F; P10SEL1 &= ~0x3F; P10DIR |= 0x3F; P10OUT &= ~0x3F; P10IE = 0; MAP_CS_initClockSignal(CS_MCLK,CS_LFXTCLK_SELECT,CS_CLOCK_DIVIDER_1); MAP_CS_initClockSignal(CS_SMCLK,CS_LFXTCLK_SELECT,CS_CLOCK_DIVIDER_1); MAP_CS_initClockSignal(CS_HSMCLK,CS_LFXTCLK_SELECT,CS_CLOCK_DIVIDER_1); MAP_CS_initClockSignal(CS_ACLK,CS_LFXTCLK_SELECT,CS_CLOCK_DIVIDER_1); MAP_CS_initClockSignal(CS_BCLK,CS_LFXTCLK_SELECT,CS_CLOCK_DIVIDER_1); BITBAND_PERI(CS->CTL2, CS_CTL2_HFXT_EN_OFS) = 0; PJSEL0 &= ~0x0C; PJSEL0 |= 0x03; PJSEL1 &= ~0x0F; PJDIR |= 0x0C; PJOUT &= ~0x0C; MAP_RTC_C_disableInterrupt(RTC_C_TIME_EVENT_INTERRUPT); if(AlarmEnabled == true) { MAP_RTC_C_enableInterrupt(RTC_C_CLOCK_ALARM_INTERRUPT); MAP_Interrupt_enableInterrupt(45); } else { MAP_RTC_C_disableInterrupt(RTC_C_CLOCK_ALARM_INTERRUPT); } Interrupt_enableSleepOnIsrExit(); while(1) { MAP_PCM_gotoLPM3(); __no_operation(); }

As some IOs are pulled up,  they're configured as input. When I push a button on my PCB to make the MCU enter LPM3, the current consumption is on the normal level. But after several seconds (30 seconds for example, it's not the same always), the current consumption will go to a high level, more than 300uA。 I replace the XMS432 REVC with a REVB verion, and run the same codes above, there is no high current phenomenon. Why could this happen?

  • Hi user4484512,

     Could you please try this code lpm3_code.c and let me know if you see the same behavior??

    With that code I'm measuring ~0.7uA. Also, which version of driverlib/mspware are you using??

      Thanks,

       David

  • I try your code, and it works correctly. Also I try my code above solely (not my whole application, but only the code above), it works correctly too. It seems like that some peripherals haven't been configured correctly before MCU enters LPM3, but I cannot figure out which peripheral.
    The driverlib version I use is V3_21_00_05.
  • Hi,

    I'm using the same version. Maybe energytrace can help you track down your problem. Maybe your application is waking up periodically, anyway please let me know if there is anything else we can do to help.

    Regards,

    David
  • Hi, DavidL,
    I finally figure out where the point is, but still cannot understand why. As my application uses RTC, and enables RTCTEVIE interrupt in active mode, I use MAP_RTC_C_disableInterrupt(RTC_C_TIME_EVENT_INTERRUPT); to disable the RTCTEVIE before entering LPM3. However, it doesn't work. In debug mode, viewing the Register window, the RTCTEVIE bit keeps 1. Then I replace MAP_RTC_C_disableInterrupt(RTC_C_TIME_EVENT_INTERRUPT); with the code as follows:
    RTC_C->CTL0 = RTCKEY;
    BITBAND_PERI(RTC_C->CTL0, RTCTEVIE_OFS) = 0;
    BITBAND_PERI(RTC_C->CTL0, RTCKEY_OFS) = 0;
    the RTCTEVIE bit can be cleared, and the current consupmtion goes to the normal level. Any idea about this?
    Thank you!
  • Hi,

     Sorry for the inconvenience. There is a bug in the RTC_C_disableInterrupt API. This should get fixed in the next driverlib version.  In the meantime you could change this API (in rtc_c.c) to:

    void RTC_C_disableInterrupt(uint8_t interruptMask)
    {
        if (interruptMask & (RTC_C_CTL0_OFIE + RTC_C_CTL0_TEVIE + RTC_C_CTL0_AIE
                + RTC_C_CTL0_RDYIE))
        {
            RTC_C->CTL0 = RTC_C_KEY
                    | ((RTC_C->CTL0 & 0x00FF)
                    & ~((interruptMask | RTC_C_CTL0_KEY_MASK)
                    & (RTC_C_CTL0_OFIE + RTC_C_CTL0_TEVIE + RTC_C_CTL0_AIE
                    + RTC_C_CTL0_RDYIE)));
            BITBAND_PERI(RTC_C->CTL0, RTC_C_CTL0_KEY_OFS) = 0;
        }
    
        if (interruptMask & RTC_C_PRESCALE_TIMER0_INTERRUPT)
        {
            BITBAND_PERI(RTC_C->PS0CTL, RTC_C_PS0CTL_RT0PSIE_OFS) = 0;
        }
    
        if (interruptMask & RTC_C_PRESCALE_TIMER1_INTERRUPT)
        {
            BITBAND_PERI(RTC_C->PS1CTL, RTC_C_PS1CTL_RT1PSIE_OFS) = 0;
        }
    }

    Please make sure that you re-build your msp432p4xx_driverlib.lib after you change this file and then you will need to use RTC_C_disableInterrupt instead of MAP_RTC_C_disableInterrupt.

      Thanks,

       David

**Attention** This is a public forum