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.

MSP430FR4133: Achieving current consumption in datasheet with LCD and RTC

Part Number: MSP430FR4133
Other Parts Discussed in Thread: ENERGYTRACE

I am currently working with the MSP430fr4133 (first time MSP430 user) on the LaunchPad Dev Board and am trying to achieve the advertised current consumption in the datasheet for LPM3.5 with the LCD, Charge Pump, and RTC. 

ILPM3.5, LCD, CP Low-power mode 3.5, excludes SVS(4) 3 V 0.90 0.94 1.27 μA

The above doesn't explicitly say RTC, but since it is LMP3.5, doesn't that mean the RTC is running? I am measuring around 3uA using the example code.  I am basically wanting to get the current consumption in the standby state, so I have the RTC counting every 10 seconds or so and am looking at the current in those 10 second intervals. Also, the examples use 

#define LPM3_bits              (SCG1+SCG0+CPUOFF)

when they put the device in LPM3.5.  But the userguide says to also set the OSCOFF bit.  Would you only want to set the OSCOFF bit if you are NOT using the XT1 crystal?

I have also tried to switch the rtc and lcd ref clocks from XT1 to VLO, but it doesn't make much of a difference.  I have everything disconnected on the Dev Kit board so the only jumper I have connected is the GND, so no communication to the emulator chip.  As a test I created code that only set the GPIO to output/ low and then put into LPM4.5, and that only consumed 0.03uA (SVS excluded) which is in line with the datasheet.  I was trying to see if something on the dev board was connected and consuming excess current but that test seemed to disprove that theory.

The code I am using is pretty much an example with some slight modifications.  Anything I am doing wrong here? This code just displays 1234 on the LCD. 

 

#define pos1 4                                               // Digit A1 - L4
#define pos2 6                                               // Digit A2 - L6
#define pos3 8                                               // Digit A3 - L8
#define pos4 10                                              // Digit A4 - L10
#define pos5 2                                               // Digit A5 - L2
#define pos6 18                                              // Digit A6 - L18

const char digit[10] =
{
    0xFC,                                                    // "0"
    0x60,                                                    // "1"
    0xDB,                                                    // "2"
    0xF3,                                                    // "3"
    0x67,                                                    // "4"
    0xB7,                                                    // "5"
    0xBF,                                                    // "6"
    0xE4,                                                    // "7"
    0xFF,                                                    // "8"
    0xF7                                                     // "9"
};

void Init_GPIO(void);
void main (void)
{
    WDTCTL = WDTPW | WDTHOLD;                                  // Stop watchdog timer

    if (SYSRSTIV == SYSRSTIV_LPM5WU)                        // If LPM3.5 wakeup
        {

            PMMCTL0_H = PMMPW_H;                                // Open PMM Registers for write
            PMMCTL0_L |= PMMREGOFF_L;                           // and set PMMREGOFF
            //PMMCTL0_L &=  ~SVSHE_L;
            __bis_SR_register(LPM3_bits | GIE);                 // Re-enter LPM3.5
        }
    else
    {
        // Initialize GPIO pins for low power
        Init_GPIO();


        // Configure XT1 oscillator
        P4SEL0 |= BIT1 | BIT2;                              // P4.2~P4.1: crystal pins
        do
        {
            CSCTL7 &= ~(XT1OFFG | DCOFFG);                  // Clear XT1 and DCO fault flag
            SFRIFG1 &= ~OFIFG;
        }while (SFRIFG1 & OFIFG);                           // Test oscillator fault flag
        CSCTL6 = (CSCTL6 & ~(XT1DRIVE_3)) | XT1DRIVE_2;     // Higher drive strength and current consumption for XT1 oscillator



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

        // Configure RTC
        RTCCTL |= RTCSS__XT1CLK | RTCIE |RTCPS__10 ;                    // Initialize RTC to use XT1 and enable RTC interrupt

        RTCMOD = 32768;                                     // Set RTC modulo to 32768 to trigger interrupt each second

        // Configure LCD pins
        SYSCFG2 |= LCDPCTL;                                 // R13/R23/R33/LCDCAP0/LCDCAP1 pins selected



        // Just enabled A1-A4 for 4 digits
        LCDPCTL0 = 0x330F;
        LCDPCTL1 = 0x0033;
        LCDPCTL2 = 0x0000;


        LCDCTL0 = LCDSSEL_0 | LCDDIV_7;                     // flcd ref freq is xtclk

        // LCD Operation - Mode 3, internal 3.08v, charge pump 256Hz
        LCDVCTL = LCDCPEN | LCDREFEN | VLCD_6 | (LCDCPFSEL0 | LCDCPFSEL1 | LCDCPFSEL2 | LCDCPFSEL3);

        LCDMEMCTL |= LCDCLRM;                               // Clear LCD memory

        LCDCSSEL0 = 0x000F;                                 // Configure COMs and SEGs
        LCDCSSEL1 = 0x0000;                                 // L0, L1, L2, L3: COM pins
        LCDCSSEL2 = 0x0000;

        LCDM0 = 0x21;                                       // L0 = COM0, L1 = COM1
        LCDM1 = 0x84;                                       // L2 = COM2, L3 = COM3

        LCDCTL0 |= LCD4MUX | LCDON;                         // Turn on LCD, 4-mux selected (LCD4MUX also includes LCDSON)

        // Display 1 2 3 4
        LCDMEM[pos1] = digit[1];
        LCDMEM[pos2] = digit[2];
        LCDMEM[pos3] = digit[3];
        LCDMEM[pos4] = digit[4];


        PMMCTL0_H = PMMPW_H;                                // Open PMM Registers for write
        PMMCTL0_L |= PMMREGOFF_L;                           // and set PMMREGOFF
        //PMMCTL0_L &=  ~SVSHE_L;

        __bis_SR_register(LPM3_bits | GIE);                 // Enter LPM3.5
        __no_operation();                                   // For debugger


    }


}
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = RTC_VECTOR
__interrupt void RTC_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(RTC_VECTOR))) RTC_ISR (void)
#else
#error Compiler not supported!
#endif
{
    switch(__even_in_range(RTCIV, RTCIV_RTCIF))
    {
        case RTCIV_NONE :
            break;

        case RTCIV_RTCIF:
            break;

        default:
            break;
    }
}


void Init_GPIO()
{
    // Configure all GPIO to Output Low
    P1OUT = 0x00;P2OUT = 0x00;P3OUT = 0x00;P4OUT = 0x00;
    P5OUT = 0x00;P6OUT = 0x00;P7OUT = 0x00;P8OUT = 0x00;

    P1DIR = 0xFF;P2DIR = 0xFF;P3DIR = 0xFF;P4DIR = 0xFF;
    P5DIR = 0xFF;P6DIR = 0xFF;P7DIR = 0xFF;P8DIR = 0xFF;
}

  • Hi Alex,

    ILPM3.5, LCD, CP Low-power mode 3.5, excludes SVS(4) 3 V 0.90 0.94 1.27 μA

    That is the consumption without RTC. In LPM 3.5, RTC and LCD are optional.\

    The example code has IRS, the power consumption in spec is in the standby mode. Every time go into IRS the cpu will wake up. It will increase the consumption.

  • Ok, thanks for the reply and clarification.  The other spec for just the RTC is 0.77uA typical at 25 degrees C.  So maybe with RTC and LCD the best I can do is a little under 2uA.  I did adjust some settings for the LCD (decreased contrast to minimum and  setting LCDLP and LCDREFMODE) and EnergyTrace is showing 1.5uA mean.  I will have to put it on an actual meter to confirm. 

  • Hi Alex,

    Is there any update?

  • I have not been able to reduce it below 1.7uA or so, but I think it will work for our case.  This MCU is a part we can actually find in large quantities so I am making sure it will work for a range of products.  I still would have liked more clarification in the datasheet about the settings used to get their listed standby current that is in the features section of the datasheet :

    Standby mode: <1 μA with real-time clock (RTC)
    counter and liquid crystal display (LCD)

  • Hi Alex,

    Could  you please post your test code? So I could have a test on my side.  

  • Hi Allen,

    Here is my test code, which is pretty much example code with some slight modifications.  EnergyTrace gives 1.6uA average....

    #include "driverlib.h"
    #include "board.h"
    //******************************************************************************
    //!
    //!   Empty Project that includes driverlib
    //!
    //******************************************************************************
    
    #define pos1 4                                               // Digit A1 - L4
    #define pos2 6                                               // Digit A2 - L6
    #define pos3 8                                               // Digit A3 - L8
    #define pos4 10                                              // Digit A4 - L10
    #define pos5 2                                               // Digit A5 - L2
    #define pos6 18                                              // Digit A6 - L18
    
    const char digit[10] =
    {
        0xFC,                                                    // "0"
        0x60,                                                    // "1"
        0xDB,                                                    // "2"
        0xF3,                                                    // "3"
        0x67,                                                    // "4"
        0xB7,                                                    // "5"
        0xBF,                                                    // "6"
        0xE4,                                                    // "7"
        0xFF,                                                    // "8"
        0xF7                                                     // "9"
    };
    
    void Init_GPIO(void);
    
    void main (void)
    {
        WDTCTL = WDTPW | WDTHOLD;                                  // Stop watchdog timer
    
        if (SYSRSTIV == SYSRSTIV_LPM5WU)                        // If LPM3.5 wakeup
            {
    
                PMMCTL0_H = PMMPW_H;                                // Open PMM Registers for write
                PMMCTL0_L |= PMMREGOFF_L;                           // and set PMMREGOFF
                PMMCTL0_L &=  ~SVSHE_L;
                __bis_SR_register(LPM3_bits | GIE);                 // Re-enter LPM3.5
            }
        else
        {
            // Initialize GPIO pins for low power
            Init_GPIO();
    
    
    
    
    
            // Configure XT1 oscillator
            // XT1 oscillator recommended for lowest power
            P4SEL0 |= BIT1 | BIT2;                              // P4.2~P4.1: crystal pins
            do
            {
                CSCTL7 &= ~(XT1OFFG | DCOFFG);                  // Clear XT1 and DCO fault flag
                SFRIFG1 &= ~OFIFG;
            }while (SFRIFG1 & OFIFG);                           // Test oscillator fault flag
    
            // CHECK THIS TO SEE IF WE CAN RUN XT1 LOWER AND HOW IT WORKS
            //CSCTL6 = (CSCTL6 & ~(XT1DRIVE_3)) | XT1DRIVE_2;     // Higher drive strength and current consumption for XT1 oscillator
    
    //        SYSCFG2 |= ADCPCTL4;
    //        PMMCTL0_H = PMMPW_H;
    //        PMMCTL2 |= EXTREFEN;
    
            // Disable the GPIO power-on default high-impedance mode
            // to activate previously configured port settings
            PM5CTL0 &= ~LOCKLPM5;
    
            // Configure RTC
            RTCCTL |= RTCSS__XT1CLK | RTCIE |RTCPS__10 ;                    // Initialize RTC to use XT1 and enable RTC interrupt
    
            RTCMOD = 32768;                                     // Set RTC modulo to 32768 to trigger interrupt every 10 seconds
    
            // Configure LCD pins
            SYSCFG2 |= LCDPCTL;                                 // R13/R23/R33/LCDCAP0/LCDCAP1 pins selected
    
    
    
            // Just enabled A1-A4 for 4 digits
            LCDPCTL0 = 0x330F;
            LCDPCTL1 = 0x0033;
            LCDPCTL2 = 0x0000;
    
    
            LCDCTL0 = LCDSSEL_0 | LCDDIV_7 | LCDLP;                     // flcd ref freq is xtclk
    
            // LCD Operation - Mode 3, internal 3.08v, charge pump 256Hz
            // Mode 3 is recommended for lowest power
            // VLCD_0 for lowest contrast
            LCDVCTL = LCDCPEN | LCDREFEN | VLCD_0 | LCDREFMODE |  (LCDCPFSEL0 | LCDCPFSEL1 | LCDCPFSEL2 | LCDCPFSEL3);
            //LCDVCTL = LCDCPEN | LCDREFEN | VLCD_3 | (LCDCPFSEL0 | LCDCPFSEL1 | LCDCPFSEL2 | LCDCPFSEL3);
    
            LCDMEMCTL |= LCDCLRM;                               // Clear LCD memory
    
            LCDCSSEL0 = 0x000F;                                 // Configure COMs and SEGs
            LCDCSSEL1 = 0x0000;                                 // L0, L1, L2, L3: COM pins
            LCDCSSEL2 = 0x0000;
    
            LCDM0 = 0x21;                                       // L0 = COM0, L1 = COM1
            LCDM1 = 0x84;                                       // L2 = COM2, L3 = COM3
    
            LCDCTL0 |= LCD4MUX | LCDON;                         // Turn on LCD, 4-mux selected (LCD4MUX also includes LCDSON)
    
            // Display 1 2 3 4
            LCDMEM[pos1] = digit[1];
            LCDMEM[pos2] = digit[2];
            LCDMEM[pos3] = digit[3];
            LCDMEM[pos4] = digit[4];
    
    
            PMMCTL0_H = PMMPW_H;                                // Open PMM Registers for write
            PMMCTL0_L |= PMMREGOFF_L;                           // and set PMMREGOFF
            PMMCTL0_L &=  ~SVSHE_L;
    
            __bis_SR_register(LPM3_bits | GIE);                 // Enter LPM3.5
            __no_operation();                                   // For debugger
    
    
        }
    
    
    }
    
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector = RTC_VECTOR
    __interrupt void RTC_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(RTC_VECTOR))) RTC_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
        switch(__even_in_range(RTCIV, RTCIV_RTCIF))
        {
            case RTCIV_NONE :
                break;
    
            case RTCIV_RTCIF:
                break;
    
            default:
                break;
        }
    }
    
    
    void Init_GPIO()
    {
        // Configure all GPIO to Output Low
        P1OUT = 0x00;P2OUT = 0x00;P3OUT = 0x00;P4OUT = 0x00;
        P5OUT = 0x00;P6OUT = 0x00;P7OUT = 0x00;P8OUT = 0x00;
    
        P1DIR = 0xFF;P2DIR = 0xFF;P3DIR = 0xFF;P4DIR = 0xFF;
        P5DIR = 0xFF;P6DIR = 0xFF;P7DIR = 0xFF;P8DIR = 0xFF;
    }
    

  • Hi Alex,

    You need to show nothing on LCD. If you mask the sentence of displaying 1234. Disable RTC interrupt. The consumption is less than 1 uA.

    #include "msp430.h"
    //#include "board.h"
    //******************************************************************************
    //!
    //!   Empty Project that includes driverlib
    //!
    //******************************************************************************
    
    #define pos1 4                                               // Digit A1 - L4
    #define pos2 6                                               // Digit A2 - L6
    #define pos3 8                                               // Digit A3 - L8
    #define pos4 10                                              // Digit A4 - L10
    #define pos5 2                                               // Digit A5 - L2
    #define pos6 18                                              // Digit A6 - L18
    
    const char digit[10] =
    {
        0xFC,                                                    // "0"
        0x60,                                                    // "1"
        0xDB,                                                    // "2"
        0xF3,                                                    // "3"
        0x67,                                                    // "4"
        0xB7,                                                    // "5"
        0xBF,                                                    // "6"
        0xE4,                                                    // "7"
        0xFF,                                                    // "8"
        0xF7                                                     // "9"
    };
    
    void Init_GPIO(void);
    
    void main (void)
    {
        WDTCTL = WDTPW | WDTHOLD;                                  // Stop watchdog timer
    
        if (SYSRSTIV == SYSRSTIV_LPM5WU)                        // If LPM3.5 wakeup
            {
    
                PMMCTL0_H = PMMPW_H;                                // Open PMM Registers for write
                PMMCTL0_L |= PMMREGOFF_L;                           // and set PMMREGOFF
                PMMCTL0_L &=  ~SVSHE_L;
                __bis_SR_register(LPM3_bits | GIE);                 // Re-enter LPM3.5
            }
        else
        {
            // Initialize GPIO pins for low power
            Init_GPIO();
    
    
    
    
    
            // Configure XT1 oscillator
            // XT1 oscillator recommended for lowest power
            P4SEL0 |= BIT1 | BIT2;                              // P4.2~P4.1: crystal pins
            do
            {
                CSCTL7 &= ~(XT1OFFG | DCOFFG);                  // Clear XT1 and DCO fault flag
                SFRIFG1 &= ~OFIFG;
            }while (SFRIFG1 & OFIFG);                           // Test oscillator fault flag
    
            // CHECK THIS TO SEE IF WE CAN RUN XT1 LOWER AND HOW IT WORKS
            //CSCTL6 = (CSCTL6 & ~(XT1DRIVE_3)) | XT1DRIVE_2;     // Higher drive strength and current consumption for XT1 oscillator
    
    //        SYSCFG2 |= ADCPCTL4;
    //        PMMCTL0_H = PMMPW_H;
    //        PMMCTL2 |= EXTREFEN;
    
            // Disable the GPIO power-on default high-impedance mode
            // to activate previously configured port settings
            PM5CTL0 &= ~LOCKLPM5;
    
            // Configure RTC
       //     RTCCTL |= RTCSS__XT1CLK | RTCIE |RTCPS__10 ;                    // Initialize RTC to use XT1 and enable RTC interrupt
            RTCCTL |= RTCSS__XT1CLK | RTCPS__10 ;                    // Initialize RTC to use XT1 and enable RTC interrupt
            RTCMOD = 32768;                                     // Set RTC modulo to 32768 to trigger interrupt every 10 seconds
    
            // Configure LCD pins
            SYSCFG2 |= LCDPCTL;                                 // R13/R23/R33/LCDCAP0/LCDCAP1 pins selected
    
    
    
            // Just enabled A1-A4 for 4 digits
    //        LCDPCTL0 = 0x330F;
    //        LCDPCTL1 = 0x0033;
    //        LCDPCTL2 = 0x0000;
    
    
            LCDCTL0 = LCDSSEL_0 | LCDDIV_6 | LCDLP|LCD4MUX;                     // flcd ref freq is xtclk
    
            // LCD Operation - Mode 3, internal 3.08v, charge pump 256Hz
            // Mode 3 is recommended for lowest power
            // VLCD_0 for lowest contrast
            LCDVCTL = LCDCPEN | LCDREFEN | VLCD_0 | LCDREFMODE |  (LCDCPFSEL0 | LCDCPFSEL1 | LCDCPFSEL2 | LCDCPFSEL3);
            //LCDVCTL = LCDCPEN | LCDREFEN | VLCD_3 | (LCDCPFSEL0 | LCDCPFSEL1 | LCDCPFSEL2 | LCDCPFSEL3);
    
            LCDMEMCTL |= LCDCLRM;                               // Clear LCD memory
    
    //        LCDCSSEL0 = 0x000F;                                 // Configure COMs and SEGs
    //        LCDCSSEL1 = 0x0000;                                 // L0, L1, L2, L3: COM pins
    //        LCDCSSEL2 = 0x0000;
    
    //        LCDM0 = 0x21;                                       // L0 = COM0, L1 = COM1
    //        LCDM1 = 0x84;                                       // L2 = COM2, L3 = COM3
    
            LCDCTL0 |= LCDON;                         // Turn on LCD, 4-mux selected (LCD4MUX also includes LCDSON)
    
            // Display 1 2 3 4
    //        LCDMEM[pos1] = digit[1];
    //        LCDMEM[pos2] = digit[2];
    //        LCDMEM[pos3] = digit[3];
    //        LCDMEM[pos4] = digit[4];
    
    
            PMMCTL0_H = PMMPW_H;                                // Open PMM Registers for write
            PMMCTL0_L |= PMMREGOFF_L;                           // and set PMMREGOFF
            PMMCTL0_L &=  ~SVSHE_L;
    
            __bis_SR_register(LPM3_bits | GIE);                 // Enter LPM3.5
            __no_operation();                                   // For debugger
    
    
        }
    
    
    }
    
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector = RTC_VECTOR
    __interrupt void RTC_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(RTC_VECTOR))) RTC_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
        switch(__even_in_range(RTCIV, RTCIV_RTCIF))
        {
            case RTCIV_NONE :
                break;
    
            case RTCIV_RTCIF:
                break;
    
            default:
                break;
        }
    }
    
    
    void Init_GPIO()
    {
        // Configure all GPIO to Output Low
        P1OUT = 0x00;P2OUT = 0x00;P3OUT = 0x00;P4OUT = 0x00;
        P5OUT = 0x00;P6OUT = 0x00;P7OUT = 0x00;P8OUT = 0x00;
    
        P1DIR = 0xFF;P2DIR = 0xFF;P3DIR = 0xFF;P4DIR = 0xFF;
        P5DIR = 0xFF;P6DIR = 0xFF;P7DIR = 0xFF;P8DIR = 0xFF;
    }

  • Ok, thanks.  Yeah I don't think I can do much better than the 1.6uA with the LCD,CP, and RTC running.  I think I should still be good for my application though....

  • Hi Alex,

    If you don't have other question, maybe I will close this ticket.

    Thanks.

**Attention** This is a public forum