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.

MSP430F5510 LPM4 problem

Other Parts Discussed in Thread: MSP430F5510

Hi,

in LPM4 I measure a current consumption of 27 uA with a MSP430F5510 (48 pin).

The datasheet states a power consumption of 1.5 uA. What's the problem?

The code i used for the test it's the following:

#include <msp430f5510.h>

void main(void)
{   
    WDTCTL = WDTPW+WDTHOLD;                   // Stop WDT
   
    P1OUT  = 0;
    P1DIR  = 0xFF;                          // P1 & P2 
    P1SEL  = 0;
    P2OUT  = 0;
    P2DIR  = 0xFF;                          // P1 & P2 
    P2SEL  = 0;
    P4OUT  = 0;
    P4DIR  = 0xFF;                          // P1 & P2 
    P4SEL  = 0;
    P5OUT  = 0;
    P5DIR  = 0xFF;                          // P1 & P2 
    P5SEL  = 0;
    P6OUT  = 0;
    P6DIR  = 0xFF;                          // P1 & P2 
    P6SEL  = 0;
    PJOUT  = 0;   
    PJDIR  = 0xFF;                            // PJ

  __bis_SR_register(LPM4_bits);             // Enter LPM4
  __no_operation();                         // For debugger
}

What's wrong? Any idea?


Thanks in advance!

Regards,

Carloalberto

  • The USB module of the '5510 draws about 20uA while watching for a bus wake-up event.

    Do this:

    USBKEYPID = USBKEY;

    USBPWRCTL = 0;

    USBKEYPID = 0;

    To turn off the USB module completely.

    Also remember there are probably other things on your board.  (Some few uA is typical.)

    Jeff

  • Carloalberto,

     

    As Jeff pointed out, many other devices or some MSP430 peripherals might be drawing current in unexpected ways. Even small LEDs can draw microamperes when turned off (dark current or other effects).

     

    Gustavo

  • Jeff,

    thank you very much for your suggestion. I added your 3 code lines and the power consumption dropped to 1.5 uA in LPM4. That's the value in the datasheet.

    In LPM3 i measure 5.2 uA, value still a little bit higher than the datasheet one.

    As you and Gustavo said, there could be other things which drain current. How can i disable all the modules in the MCU? I want to be sure that everything is off and turn on just what i need!

    Any suggestion?

     

    Thank you!

    Regards,

    Carloalberto

  • Hi again Carloalberto,

    Glad the USB module was the only problem with LPM4.  It can be hard to search for unexplained uA.

    As for LPM3, can you post that code too?  Or is it the same as your LPM4 test code except for the  __bis_SR_register( ) statement?

    The prime suspect would be REFO.  The point of LPM3 (instead of LPM4) is usually to keep ACLK going via XT1 or REFO or VLO.  As a general rule, whenever XT1 is selected for some function and is needed but unavailable for whatever reason, the UCS substitutes REFO, which costs a few uA.

    As an experiment, connect ACLK to VLO (instead of XT1, which is the default).  Use the SELA field in the UCSCTL4 register.  This should save the few uA.

    Jeff

  • Carloalberto Torghele said:

    As you and Gustavo said, there could be other things which drain current. How can i disable all the modules in the MCU? I want to be sure that everything is off and turn on just what i need!

    I'm wondering this same thing.  Right now I'm trying to track down stray current in my circuit and I didn't know that there were peripherals that defaulted to draining current.  Is there some document that states what peripherals drain current by default (obviously the datasheet, but I'm wondering if there is something more concise)?

    Doug

  • I don't know specifically in your case, but I would look at the user's guide. I believe most peripherals  are off, but you never know unless you check.

  • For what it's worth, here's my own list of "optional" functions that are active by default (BOR):

    • USB
    • PMM (supply supervisors and monitors)
    • REFO standing in for XT1 (AM through LPM3)
    • Watchdog Timer

    Also keep in mind that other devices (like the ADC, timers, and others) don't shut down during PUC.  So a truly thorough initialization strategy might need to address these other modules too. 

    Gustavo's advice is good.  Check the User's Guide.  There really aren't that many peripherals.  However, a one-page summary of the status of all peripherals after BOR, POR, and PUC would be very handy.  I haven't ever seen such a thing.

    Jeff

     

  • Jeff Tenney said:
    So a truly thorough initialization strategy might need to address these other modules too. 


    One can assume that after last fimrware update, the device had a power cycle (except for rare projects with field update), and all but the four modules you mentioned are off.

    So before entering low power, it is only necessary to explicitely deactivate all modules which are used throughout the application. Only those may have been enabled. (disabling them if they haven't been enabled yet, won't hurt)

    So if all that the applicaiton used was the USCIA0, then setting SWRST on it should all that's needed (besides the mentioned four) to deactivate everything.

  • Sorry if I answear just now but i've been away.

    My LPM3 testing code it's the same as the LPM4 cose except for __bis_SR_register(LPM3_bits);

    As you suggest (thanks!) I connected ACLK to VLO

    UCSCTL4 &= 0xF8FF;
    UCSCTL4 |= SELA__VLOCLK;

    and the power consumption dropped to 1.6 uA (before it was 5.2 uA) !

    Disabling SVS and SVM with this code:

    PMMCTL0_H = PMMPW_H;                // PMM Password
    SVSMHCTL &= ~(SVMHE+SVSHE);         // Disable High side SVS
    SVSMLCTL &= ~(SVMLE+SVSLE);         // Disable Low side SVS

    the power consumption drop to 1.3 uA.


    So i think we figured out the issue!

    If i enable all the clocks i need in my application the power consumpion rise to 2.4 uA. Do you think is it ok or there is something more than i can improve (see the code below)?

    The code it's the following:

    void halMcuInit(void)
    {
        // Stop watchdog
        WDTCTL = WDTPW + WDTHOLD;                // Stop watchdog timer

        // Set up clock system on MCU to fit your system
        // Target specific implementation
     
        P5SEL |= BIT4+BIT5;                        // Port select XT1
        UCSCTL6 &= ~XT1OFF;                        // Set XT1 On

        P5SEL &= ~(BIT2+BIT3);                  // Don't select XT2
        UCSCTL6 |= XT2OFF;                        // XT2 Off
        UCSCTL6 |= XCAP_3;                      // Internal load cap 12 pF

        // Loop until XT2 fault flag is cleared
        do
        {
            UCSCTL7 &= ~XT1LFOFFG;                      // Clear XT1 LF fault flags
        }while (UCSCTL7&XT1LFOFFG);                   // Test XT1 LF fault flag

        __bis_SR_register(SCG0);                  // Disable the FLL control loop
     
        UCSCTL3 = SELREF__XT1CLK + FLLREFDIV_0;      // XT1 as FLL ref, FLL reference divider at 1

        UCSCTL0 = 0x0000;                         // Set lowest possible DCOx, MODx

        UCSCTL1 = DCORSEL_2;                      // Select DCO range for 4 MHz operation
        UCSCTL2 = 30 + FLLD_2;                      // x (30 +1), x 4

        UCSCTL6 &= ~(XT1DRIVE_3);                 // Xtal is now stable, reduce drive strength to the lowest current consumption.

        UCSCTL4 = SELA__XT1CLK + SELM__DCOCLK + SELS__DCOCLK;     // Set ACLK = XT1, MCLK = DCOCLOCK, SMCLK  = DCOCLOCK,

        UCSCTL8 &= 0xF8;//~(ACLKREQEN | MCLKREQEN | SMCLKREQEN);
        UCSCTL6 |= 0x0001;
       
        __bic_SR_register(SCG0);                  // Enable the FLL control loop

        // Worst-case settling time for the DCO when the DCO range bits have been
        // changed is n x 32 x 32 x f_MCLK / f_FLL_reference. See UCS chapter in 5xx
        // UG for optimization.
        // 32 x 32 x [ 32768 x (30 + 1) x 4 Hz] / 32768 Hz = 126976 = MCLK cycles for DCO to settle
        __delay_cycles(126976);
       
        // Loop until XT1,XT2 & DCO stabilizes.
        do
        {
            UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG  + DCOFFG);
            // Clear XT2,XT1,DCO fault flags
            SFRIFG1 &= ~OFIFG;                      // Clear fault flags
        }while (SFRIFG1&OFIFG);                   // Test oscillator fault flag
    }

    void main(void)
    {   
        WDTCTL = WDTPW+WDTHOLD;                   // Stop WDT
       
        P1OUT  = 0;
        P1DIR  = 0xFF;                          // P1 & P2 
        P1SEL  = 0;
        P2OUT  = 0;
        P2DIR  = 0xFF;                          // P1 & P2 
        P2SEL  = 0;
        P4OUT  = 0;
        P4DIR  = 0xFF;                          // P1 & P2 
        P4SEL  = 0;
        P5OUT  = 0;
        P5DIR  = 0xFF;                          // P1 & P2 
        P5SEL  = 0;
        P6OUT  = 0;
        P6DIR  = 0xFF;                          // P1 & P2 
        P6SEL  = 0;
        PJOUT  = 0;   
        PJDIR  = 0xFF;                            // PJ

        USBKEYPID = USBKEY;
        USBPWRCTL = 0;
        USBKEYPID = 0;
       
        // Disable SVS
        PMMCTL0_H = PMMPW_H;                  // PMM Password
        SVSMHCTL &= ~(SVMHE+SVSHE);    // Disable High side SVS
        SVSMLCTL &= ~(SVMLE+SVSLE);      // Disable Low side SVS

        halMcuInit();
       
      __bis_SR_register(LPM3_bits);             // Enter LPM3
      __no_operation();                                      // For debugger
    }

    Do you think is it ok to disable SVS and SVM? Why would i enable them?

    Thanks!

    Regards,

    Carloalberto

**Attention** This is a public forum