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.

why device consumption is so high in low power mode when i use external crystal as the device mains-clock?

Other Parts Discussed in Thread: MSP430F5510

hi

   i use the chip MSP430F5510,when i use the internal DCO as the source  of the device,i found some problem,and when i use the external crystal as the the soure clock of the chip,the problem doesnot occur again,thus,i want use the external crystal which frequence is 12Mhz,the circuit diagram shown as follows

so in my code i need to initialize the clock module before the micro-controller to do other things,i want the ACK is 32Khz,the MCLK and SMCLK are 12Mhz.

The code used to initialize the clock module refers the sample example downloaded form the TI official website is as follows,Of course,I have changed some place suited  for my system:

P5SEL |= BIT2 + BIT3;
P5SEL |= BIT4 + BIT5;

UCSCTL6 &= ~(XT2OFF + XT1OFF);
UCSCTL6 |= XT2DRIVE_1;
do
{
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);
SFRIFG1 &= ~OFIFG; // Clear fault flags
}while (SFRIFG1&OFIFG); // Test oscillator fault flag

//UCSCTL6 &= ~(XT2DRIVE_1 + XT1DRIVE_0); // Decrease XT2 Drive according to

// expected frequency
UCSCTL4 |= (SELA_0 + SELM_5 + SELS_5); // ACLK =XT1 SMCLK=MCLK=XT2

UCSCTL8 &=~ (SMCLKREQEN + MCLKREQEN);

when i use this code to initialize the clock mode,i found the current consumption is very large,when the micro-conntroller enter into LPM3 mode,the current is about 330uA,what is wrong in my code?can someboby help me  point out the error in my code!

thank you!

  •      Now i was very anxious,if someone encountered the same problem,pleae share me,give me advice as possible,thank you

  • Hello,

    when I am using LPM3 in my PCB design I get down to about 5 µA, but only when I meassure the current without the JTAG programer attached ( it causes around 190µA in my meassurments ). So how do you meassure your current consumption, perhaps you still have some other ICs ( external DC regulation, etc. ) active, which need some power too.

    LPM3 should shut down the high speed clock anyway so the  12 MHz clock should not be the problem, the low frequency oscillator is still active, so there could be some wrong settings ( drive strength ..)  in your configuration, but still this should only cause some x10µA and not 300µA.

    Hope that hellps a bit.

    Regards, Seb

    PS:

    before entering LPM3 I do always swtich all of the µC Ports to a defined level, so I deselect all PSEL Pins ( of course not those I still want to use in LPM3, like real time clock crystal or communication Ports, etc ) and pull all Ports to inputs with pull downs ( its somewhere in the USerGuide which settings are recommended for lowest power consumption).

    I cannot see in your code wheather you do that or not, this could cause some 300 µA of current easily I think.

  • hi

      thank you for your advice,The circuit board i designed  indeed has other ICs, the total consumption is about 30uA,I measure the current without the JTAG and let  the micro-connroller directly into LPM3 mode without doing other things,and the current is about 300uA when i use external crtstal as soures clock.The initailization code is as follow:

    P5SEL |= BIT4+BIT5; // Port select XT1
    UCSCTL6 &= ~(XT1OFF); // XT1 On
    UCSCTL6 |= XCAP_3; // Internal load cap

    // Loop until XT1 & 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

    UCSCTL6 &= ~(XT1DRIVE_0); // Xtal is now stable, reduce drive
    UCSCTL4 |= SELA_0; // ACLK = LFTX1 (by default)

    UCSCTL3 = SELREF_0; // Set DCO FLL reference = LXF1
    UCSCTL0 = 0x0000; // Set lowest possible DCOx, MODx

    __bis_SR_register(SCG0); // Disable the FLL control loop
    UCSCTL1 = DCORSEL_5; // Select DCO range 16MHz operation
    UCSCTL2 |= 249; // Set DCO Multiplier for 8MHz
    // (N + 1) * FLLRef = Fdco
    // (249 + 1) * 32768 = 8MHz
    __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 8 MHz / 32,768 Hz = 250000 = MCLK cycles for DCO to settle
    __delay_cycles(250000);

    but if i do not use the external crystal supply the system clock,use the DCO which multipler to 8Mhz base from XT1(32kHz),I measure the current  is only 40uA,why  the result 0f  two measurements  difference about 300uA?The initailization code is as follow:

    P5SEL |= BIT2+BIT3; // Port select XT2
    P5SEL |= BIT4+BIT5; // Port select XT1

    UCSCTL6 |= XCAP_3;
    UCSCTL6 &= ~(XT2OFF + XT1OFF); // Set XT2,XT1 On
    UCSCTL6 |= (XT2DRIVE1 + XT1DRIVE0); // Internal load cap

    // XT1 is by default on as it is used default reference for the FLL - internal load caps?
    // 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

    //UCSCTL6 &= ~XT2DRIVE1; // Decrease XT2 Drive according to
    // expected frequency
    UCSCTL4 |= SELA_0 + SELM_5 + SELS_5; // Select SMCLK, ACLK source and DCO source

    I think the XT2 is not be closed in the low power mode,when i read the datasheet,i found some infomation about the XT2,shown as follow

    thus,how can i do the micro-conntroller enter the LPM3 mode!

    thank you !

  • liangliang lou said:
    P5SEL |= BIT2+BIT3; // Port select XT2

    Try using your code with external XT1 but switch off XT2 actively setting the propriate P5SEL bits, and measure the current, this is what would I do.

  • hi

      ok,i refer your to your suggestion , turn off the XT2,the code changed as follows

    //P5SEL |= BIT2+BIT3; // Port select XT2   unconfig this pins
    P5SEL |= BIT4+BIT5; // Port select XT1

    //UCSCTL6 &= ~XT2OFF; // Set XT2 On   default set is closed
    UCSCTL6 &= ~XT1OFF; // Set XT1 On     only open XT1
    UCSCTL6 |= XCAP_3; // Internal load cap

    // XT1 is by default on as it is used default reference for the FLL - internal load caps?
    // 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

    UCSCTL6 &= ~XT1DRIVE0; // Decrease XT2 Drive according to

    // expected frequency
    UCSCTL4 |= SELA_0 ;  ACLK form XT1,MCLK and SMCLK form DCO

    the result i got is about 40uA!!

  • Whenyou go into LPM3, thsi will disable SMCLK, but not necessarily the oscillator that drives it. This is because bringing the oscillator back to live on LPM exit can take a long time - possibly longer and therefore more power consuming than what you saved by going into LPM at all.

    However, different behaviour has been observed on different MSPs. I dimly remember from an old thread that going into LPM4 will indeed shut off the LFXT1 crystal together with ACLK on 54xxA but not on 54xx non-A.

  • hi

       thank you for your reply,but i does noy understand what your means,in my opinion,the MCLK and SMCLK will be disable and the device consumption is very low,but the phenomenon i encountered shows the MCLK and SMCLK were not be close out,

    I have cleared  MCKREQEN and SMCLK in the initailization of the UCS module,but the problem is still exist,the current consumption of my circuit board is 300uA, i have no idea about this problem.

    regards!

  • Well, there is a difference between a clock and an oscillator. SMCLK is a clock. If it is switched off, all attached devices won't get a clock. However, the oscillator that drives it is not necessarily off then.
    It is like if you remove the fuse, all the lights go out but the power plant won't stop working.

    In case of DCO (the internal, fast-on oscillator) it can be switched off if nobody is using it. In case of an oscillator (slow-on, external), this is not necessarily the case and maybe even unwanted.

    YOu can tell the clock system that you really want to shutdown XT2 oscillator too by setting the XT2OFF bit before going into LPM.

**Attention** This is a public forum