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.

CC430F5137: the power consumption during LPM3 sleep period is high

Part Number: CC430F5137


Hi,

My product uses the CC430F5137 and we have a problem with the high current consumption occurred sometimes during the LPM3 mode. The current won't  not back to uA but stay in 1mA during the sleep period (LPM3). 

According to the PMM11 workaround in "SLAZ094X-October 2012-Revised May 2018" issued by TI I tried to set the "MCLK divide by two prior to entering LPM3" but found the current is even much higher.

Below is part of my code and the measured current of the product.

//make VLO (10khz) as ACLK's clock source
UCSCTL4 = SELA__VLOCLK + SELS__DCOCLKDIV + SELM__DCOCLKDIV;

LED_OFF

if (state != STATE_RX_WOR)
{
Strobe(RF_SIDLE);
Strobe(RF_SFRX);
Strobe(RF_SFTX);
Strobe(RF_SCAL);
while ((Strobe(RF_SNOP) & 0xF0) != 0x00 );

state = STATE_RX_WOR;

// Set up 2 preamble bytes
WriteSingleReg(MDMCFG1, (rfSettings.mdmcfg1 & 0x8f));
// Set up 16 bit sync word (16/16)
WriteSingleReg(MDMCFG2, (rfSettings.mdmcfg2 & 0xf4) | 0x02);

//what should happen when a packet has been received:
//RXOFF_mode and TXOFF_mode in IDLE
WriteSingleReg(MCSM1, 0x30);
// Disable CRC at end of packet
WriteSingleReg(PKTCTRL0, (rfSettings.pktctrl0 & ~0x04));
//disable appending RSSI and LQI info at the payload
WriteSingleReg(PKTCTRL1, (rfSettings.pktctrl1 & 0xFB));

WriteSingleReg(PKTLEN, 2); // Set up packet length
}

T_WOR_1s =72; //4sec


Strobe(RF_SIDLE);
Strobe(RF_SPWD); //turn off RF

WDTCTL =WDTPW+WDTTMSEL+WDTCNTCL+WDTIS2+WDTSSEL_2+WDTIS1; //1/16s
SFRIE1 |= WDTIE; // Enable WDT interrupt

//set MCLK divide by 2
// UCSCTL5 = (UCSCTL5 & 0xFFF0) | DIVM__2;
__bis_SR_register(LPM3_bits + GIE); //enter LPM3 and re-enable interrupts


// CPU SLEEPS HERE!
//set MCLK divide by 32
// UCSCTL5 = (UCSCTL5 & 0xFFF0) | DIVM__32;

__delay_cycles (800ul); //waiting
SFRIE1 &= ~WDTIE; // disable WDT interrupt
//ACLK = XT1 (default), SMCLK = DCOCLKDIV (default), MCLK = DCOCLKDIV (default)
UCSCTL4 = SELA__XT1CLK + SELS__DCOCLKDIV + SELM__DCOCLKDIV;
//delay_cycles(x) is stopping in the code and waiting for x MCLK cycles

//==========================================
// Handle pending wake-up flags
//==========================================

 

the measured current before adding divide MCLK by two

the measured current after adding divide MCLK by two

  here is the recorded current: the current did not back to uA during LPM3 sleep period. The wakeup time is 2us.

  • Hello Derong,

    It looks like the third and fourth screenshots are identical to the first two. For those screenshots, the operation seems normal: sleep, wake-up, go back to sleep. For the last screenshot, I can see where the device seems to be coming out of LPM3 mode, but I'm not sure why it's behaving like this. It doesn't seem to fully wake up like the first and third screenshots.

    In the last screenshot, when the current goes to 1mA, is this the device supposed to wake up completely? What's the bottom scale in units of time? uS? I suspect that this issue is caused by an errata (which seem to be many unfortunately). I would recommend starting with one of our LPM3 code examples for the CC430F5137, implementing the errata workarounds, and measuring the current. Then, start adding your code piece by piece to see what's causing this strange start-up behavior.

    cc430x513x_LPM3_1.c

    /* --COPYRIGHT--,BSD_EX
     * Copyright (c) 2012, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     *******************************************************************************
     * 
     *                       MSP430 CODE EXAMPLE DISCLAIMER
     *
     * MSP430 code examples are self-contained low-level programs that typically
     * demonstrate a single peripheral function or device feature in a highly
     * concise manner. For this the code may rely on the device's power-on default
     * register values and settings such as the clock configuration and care must
     * be taken when combining code from several examples to avoid potential side
     * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
     * for an API functional library-approach to peripheral configuration.
     *
     * --/COPYRIGHT--*/
    //******************************************************************************
    //   CC430x513x Demo - Enters LPM3 (ACLK = LFXT1)
    //
    //   Description: Configure ACLK = LFXT1 and enters LPM3. Measure current.
    //   Note: SVS(H,L) & SVM(H,L) are disabled
    //   ACLK = LFXT1 = 32kHz, MCLK = SMCLK = default DCO
    //
    //                 CC430x513x
    //             -----------------
    //        /|\ |              XIN|-
    //         |  |                 | 32kHz
    //         ---|RST          XOUT|-
    //            |                 |
    //
    //   M. Morales
    //   Texas Instruments Inc.
    //   April 2009
    //   Built with CCE Version: 3.2.2 and IAR Embedded Workbench Version: 4.11B
    //******************************************************************************
    
    #include <msp430.h>
    
    int main(void)
    {  
      WDTCTL = WDTPW+WDTHOLD;                   // Stop WDT
    
      P5SEL |= BIT0 + BIT1;                     // Select XT1
      UCSCTL6 |= XCAP_3;                        // Internal load cap
    
      // Loop until XT1,XT2 & DCO stabilizes
      do
      {
        UCSCTL7 &= ~(XT1LFOFFG + DCOFFG);
                                                // Clear LFXT1,DCO fault flags
        SFRIFG1 &= ~OFIFG;                      // Clear fault flags
      }while (SFRIFG1 & OFIFG);                   // Test oscillator fault flag
    
      UCSCTL6 &= ~(XT1DRIVE_3);                 // Xtal is now stable, reduce drive
                                                // strength
    
      P1OUT = 0x00; P2OUT = 0x00; P3OUT = 0x00; P5OUT = 0x00;
      P1DIR = 0xFF; P2DIR = 0xFF; P3DIR = 0xFF; P5DIR = 0x03;
      
      PJOUT = 0x00;
      PJDIR = 0xFF;
    
      // Turn off SVSH, SVSM
      PMMCTL0_H = 0xA5;
      SVSMHCTL = 0; 
      SVSMLCTL = 0; 
      PMMCTL0_H = 0x00; 
    
      __bis_SR_register(LPM3_bits);             // Enter LPM3
      __no_operation();                         // For debugger
    }

    Regards,

    James

    MSP Customer Applications

  • Sorry I uploaded the wrong image file. The correct should look like this:

    In the last screenshot, the device should wake up for 1ms and then back to sleep.

    The Errata issued in May 2018 mentioned some bugs in CC430F5137 can corrupt the PC/SR register. I have contacted with IAR for adding a flag in the compiler option. They should tell me if adding the flag can resolve the problem.

    I am also testing my software with  what the errata suggested in the workaround:

    1. adding the flag 

    2. setting MCLK divide by 2

    3. use XT2 as the SMCLK oscillator source

    I found the 1mA problem occurred 5 times in the 17-hour test record but the 1mA did not last as long as in the old test record.

    This weekend I will test the code with adding "Turn off SVSH, SVSM before entering LPM3" as suggested in your comment and post the test result next Monday.

    Thanks,

    Derong Yuan

    Seabreeze International Corporation

    2018-7-13

    Sorry my laptop got a power reset this weekend so I will run the test again.

    I tested what listed in the workaround for PMM12 and found if use XT2 as the SMCLK oscillator source instead of the DCO CC430F5137 will consume much more power. So I have no choice but to try enable SMCLKREQEN in register UCSCTL8 and run the test again.

    this is the setting for all clock control registers:
    //------------------------------------------------------------------------------
    /* MCU clock system (UCS) initialization
    * - Start the 32768Hz crystal oscillator XT1
    * - Configure the FLL to generate 8MHz clock using XT as reference
    * - MCLK = SMCLK = 244 * fXT1 = 7.995392MHz from DCO/2.
    */
    UCSCTL3 |= SELREF_2; // Set DCO FLL reference = REFO
    UCSCTL4 = SELA_2+SELS_3+SELM_3; //ACLK = REFO, MCLK=SMCLK=DCOCLK.

    UCSCTL6 = XT2OFF & msk_1 | //XT2 is off
    XT1OFF & msk_1; // XT1 is Off

    __bis_SR_register(SCG0); // disable FLL pulling of DCO
    UCSCTL0 = 0x0000; // set DCO to lowest tap
    // FLL loop divide-by-2, Fsys/Fxt1 ratio = 243+1 = 244
    UCSCTL2 = FLLD__2 | 243;
    UCSCTL1 = DCORSEL_5; // good for 10..20MHz, we run Fdco = 16MHz and divide
    // by 2 to make sure that clock duty cycle = 50% since
    // we run at the 8MHz max limit for PMMCOREV = 0.
    __bic_SR_register(SCG0); // re-enable FLL control
    // maximum FLL settling delay = 1024 * f_MCLK / f_FLLREF
    __delay_cycles(250000lu);

    bTimeout = 100; // try max 100ms
    // wait for ALL oscillator fault flags to become clear
    while (SFRIFG1 & OFIFG)
    {
    __delay_cycles (8000lu); // delay ~1ms
    // clear individual flags
    UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + XT1HFOFFG + DCOFFG);
    SFRIFG1 &= ~OFIFG; // clear sum flag
    if (--bTimeout == 0)
    {
    //something wrong
    SOFTWARE_BOR_REBOOT
    }
    }

    //set SMCLKREQEN bit 1 in UCSCTL8 register: SMCLK conditinal requests are enabled
    UCSCTL8 |=SMCLKREQEN;

    //ACLK = XT1 (default), SMCLK = DCOCLKDIV (default), MCLK = DCOCLKDIV (default)
    UCSCTL4 = SELA__XT1CLK + SELS__DCOCLKDIV + SELM__DCOCLKDIV;

    This is my test result for PMM12
    1. use DCO as the SMCLK oscillator source


    2.use XT2 as the SMCLK oscillator source instead of the DCO


    3. use DCO as the SMCLK oscillator source but set SMCLKREQEN bit 1 in UCSCTL8 register: SMCLK conditinal requests are enabled

    I have another question on your suggestion to add the codes to turn off SVSH and SVSM but I do not know if the codes should be added in the init process of the software which will be executed only once or just before the LPM3 instruction as shown below which will be executed in the BIG loop.
    //=====================================================
    // MAIN LOOP
    //=====================================================
    while (1)
    {
    CLRWDT_16s

    //make VLO (10khz) as ACLK's clock source
    UCSCTL4 = SELA__VLOCLK + SELS__DCOCLKDIV + SELM__DCOCLKDIV;

    ..........

    // Turn off SVSH, SVSM
    PMMCTL0_H = 0xA5;
    SVSMHCTL = 0;
    SVSMLCTL = 0;
    PMMCTL0_H = 0x00;

    //set MCLK divide by 2
    UCSCTL5 = (UCSCTL5 & 0xFFF0) | DIVM__2;
    __bis_SR_register(LPM3_bits + GIE); //enter LPM3 and re-enable interrupts


    // CPU SLEEPS HERE!
    __delay_cycles (800ul); //waiting
    //set MCLK divide by 1 
    UCSCTL5 = UCSCTL5 & 0xFFF0;


    SFRIE1 &= ~WDTIE; // disable WDT interrupt
    //ACLK = XT1 (default), SMCLK = DCOCLKDIV (default), MCLK = DCOCLKDIV (default)
    UCSCTL4 = SELA__XT1CLK + SELS__DCOCLKDIV + SELM__DCOCLKDIV;

    //==========================================
    // Handle pending wake-up flags
    //==========================================
    CLRWDT_16s

    Derong Yuan

    Seabreeze International Corporation

    2018-7-16

  • Sorry my laptop got a power reset in the weekend so I will run the test again.

    But I have a question here on the workaround of the PMM12: how much current will be added If the SMCLK use XT2 as the oscillator source instead of the DCO ? In my current software I turned off both XT1 and XT2 in UCSCTL6.

    Below shows the XT2 is turned on:

    //------------------------------------------------------------------------------
    /* MCU clock system (UCS) initialization
    * - Start the 32768Hz crystal oscillator XT1
    * - Configure the FLL to generate 8MHz clock using XT as reference
    * - MCLK = SMCLK = 244 * fXT1 = 7.995392MHz from DCO/2.
    */
    UCSCTL3 |= SELREF_2; // Set DCO FLL reference = REFO
    //UCSCTL4 = SELA_2+SELS_3+SELM_3; //ACLK = REFO, MCLK=SMCLK=DCOCLK.
    UCSCTL4 = SELA_2+SELS_5+SELM_3; //ACLK = REFO, MCLK=DCOCLK. SMCLK=XT2


    UCSCTL6 = XT2OFF & msk_0 | //XT2 is on 
    XT1OFF & msk_1; // XT1 is Off 

    __bis_SR_register(SCG0); // disable FLL pulling of DCO
    UCSCTL0 = 0x0000; // set DCO to lowest tap
    // FLL loop divide-by-2, Fsys/Fxt1 ratio = 243+1 = 244
    UCSCTL2 = FLLD__2 | 243; 
    UCSCTL1 = DCORSEL_5; // good for 10..20MHz, we run Fdco = 16MHz and divide
    // by 2 to make sure that clock duty cycle = 50% since
    // we run at the 8MHz max limit for PMMCOREV = 0.
    __bic_SR_register(SCG0); // re-enable FLL control
    // maximum FLL settling delay = 1024 * f_MCLK / f_FLLREF
    __delay_cycles(250000lu); 

    bTimeout = 100; // try max 100ms
    // wait for ALL oscillator fault flags to become clear
    while (SFRIFG1 & OFIFG) 
    {
    __delay_cycles (8000lu); // delay ~1ms
    // clear individual flags
    UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + XT1HFOFFG + DCOFFG); 
    SFRIFG1 &= ~OFIFG; // clear sum flag
    if (--bTimeout == 0)
    {
    //something wrong
    SOFTWARE_BOR_REBOOT 

    }
    //ACLK = XT1 (default), SMCLK = DCOCLKDIV (default), MCLK = DCOCLKDIV (default) 
    UCSCTL4 = SELA__XT1CLK + SELS__DCOCLKDIV + SELM__DCOCLKDIV;

    Another question is the turning off both SVSH and SCSM instructions be executed once  in the hardware init or once-per-looping before the LPM3 instruction in the MAIN LOOP as shown below?

    //=====================================================
    // MAIN LOOP
    //=====================================================

    while(1)

    {

    CLRWDT_16s

    //make VLO (10khz) as ACLK's clock source
    UCSCTL4 = SELA__VLOCLK + SELS__DCOCLKDIV + SELM__DCOCLKDIV;

    ..........

    WDTCTL =WDTPW+WDTTMSEL+WDTCNTCL+WDTIS2+WDTSSEL_2+WDTIS1; //1/16s
    SFRIE1 |= WDTIE; // Enable WDT interrupt 

    // Turn off SVSH, SVSM
    PMMCTL0_H = 0xA5;
    SVSMHCTL = 0;
    SVSMLCTL = 0;
    PMMCTL0_H = 0x00;

    //set MCLK divide by 2
    UCSCTL5 = (UCSCTL5 & 0xFFF0) | DIVM__2;
    __bis_SR_register(LPM3_bits + GIE); //enter LPM3 and re-enable interrupts


    // CPU SLEEPS HERE!
    __delay_cycles (800ul); //waiting
    //set MCLK divide by 32
    UCSCTL5 = UCSCTL5 & 0xFFF0;


    SFRIE1 &= ~WDTIE; // disable WDT interrupt
    //ACLK = XT1 (default), SMCLK = DCOCLKDIV (default), MCLK = DCOCLKDIV (default)
    UCSCTL4 = SELA__XT1CLK + SELS__DCOCLKDIV + SELM__DCOCLKDIV;
    //delay_cycles(x) is stopping in the code and waiting for x MCLK cycles

    //==========================================
    // Handle pending wake-up flags
    //==========================================
    CLRWDT_16s

    .........

    }

    Thanks,

    Derong Yuan

  • Hello,

    The code example that I shared earlier seems to just enter LPM3 and stay there. I was just wanting you to try it on your device and see what the current consumption was. Unfortunately, there are a lot of errata on this device, specifically around PMM. Due to the many different configurations, please go through each errata carefully and verify if what you're doing applies to these errata.

    Also, when you post code, please use the Syntax Highlighter tool (looks like "</>") found under the "Insert Code, Attach Files and more..." link shown after you click the "Reply" button. It makes the code much more readable. Also, with all your commented-out code, that makes reading through it even more challenging.

    Regards,

    James

    MSP Customer Applications

**Attention** This is a public forum