Sign in to follow this  
Followers 0
rord100

MSP430G2553 LPM4 works by current doesn't go bellow ~ 75 ?A

29 posts in this topic

Hi,

I am new to this form yet I have a question regarding MSP430G2553 low power mode (LPM4). My setup includes an MSP-EXP430G2 Launchpad with MSP430g2553 controller assembled on an external self made PCB with RX, TX, TEST,  RST, VCC  connected to the Luanchpad through a FLUKE 187 (high quality meter ) micro Amper meter and GND pins. I tried the recommended sketch, attached bellow,  I found on another forum  to test the LPM4 mode, including the "for(uint8_t i;i<20;i++) pinMode(i, INPUT_PULLDOWN)" routine

followed by pinMode(P1_3,INPUT_PULLUP); and pinMode(P1_0,OUTPUT);

 It seem to work but when in LPM4, I measure 75 micro ampers instead of the desired ~ 0.1 micro amps.

 

Can anybody  please advise how can I reach the desired ~ 0.1 microamp.

 

Thank you

 

@@rord100

 

The sketch I used to test the LPM4 mode

void setup()
{
pinMode(P1_1,INPUT_PULLDOWN);
pinMode(P1_2,INPUT_PULLDOWN);
pinMode(P1_3,INPUT_PULLDOWN);
pinMode(P1_4,INPUT_PULLDOWN);
pinMode(P1_5,INPUT_PULLDOWN);
pinMode(P1_6,INPUT_PULLDOWN);
pinMode(P1_7,INPUT_PULLDOWN);

pinMode(P2_0,INPUT_PULLDOWN);
pinMode(P2_1,INPUT_PULLDOWN);
pinMode(P2_2,INPUT_PULLDOWN);
pinMode(P2_3,INPUT_PULLDOWN);
pinMode(P2_4,INPUT_PULLDOWN);
pinMode(P2_5,INPUT_PULLDOWN);
pinMode(P1_3,INPUT_PULLUP); //Enable inputs on P1_3 (onboard button)
pinMode(P1_0,OUTPUT); //Enable output on P1_0 (onboard red LED)
attachInterrupt(P1_3,Interrupt, FALLING); //attach our interrupt routine to P1_3
}

void loop()
{
LPM4; //whenever the loop runs, switch back into LPM4
//we could put code here that would run after every Interrupt - see warning in text.
}

void Interrupt(void) //Our interrupt routine
{
digitalWrite(P1_0,!digitalRead(P1_0)); //toggle the red LED
};
Edited by bluehash
[ADMIN] - Please use code tags <> to illustrate code.

Share this post


Link to post
Share on other sites

Achieving ultra-low power can sometimes take a bit of work. It might be helpful to see a circuit diagram. If you have a pull-down resistor with a logic HIGH applied you will have power loss through that resistor (for example your serial lines?)

 

Are there any other parts fitted on your custom PCB?

Just having the debugger connected adds additional power loss, even when the MSP is in LPM4.

Share this post


Link to post
Share on other sites

I might be wrong but all those INPUT_PULLDOWN might consume some power, so consider only enabling the pins you are using, which here would be P1_0 and P1_3.

After defining P1_0 as OUTPUT, you should give it a known state, like "digitalWrite(P1_0, LOW);".

 

Also, you might consider moving LPM4 to the end of setup() and leave loop() empty, or insert "while(1) {};" after calling LPM4.

rord100 likes this

Share this post


Link to post
Share on other sites

Achieving ultra-low power can sometimes take a bit of work. It might be helpful to see a circuit diagram. If you have a pull-down resistor with a logic HIGH applied you will have power loss through that resistor (for example your serial lines?)

 

Are there any other parts fitted on your custom PCB?

Just having the debugger connected adds additional power loss, even when the MSP is in LPM4.

Hi greeeg,

 

Thank you for your input. Attached please find the circuit diagram I use. I have no external pull down resistors at all.

All other parts on my PCB, like 4 LEDs and one buzzer are active only when the program is awake. When in LPM4 mode all LEDs outputs are set to HIGH and the Buzzer output is set to LOW , so no current should flow through these guys.

Regarding the RX, TX, RST and TEST pins , when I disconnect RX and TX there is no change in current consumption , still 75

430h2.pdf

Share this post


Link to post
Share on other sites

Hi,

 

Did you get off all jumpers ? Some current can be drown throught serial connexions.

Hi,

Thank you, I did but to no avail, still same current consumption, But I realized that when I disconnect the TEST jumper from the Luanchpad the program stop running. Any Idea ?

Share this post


Link to post
Share on other sites

Achieving ultra-low power can sometimes take a bit of work. It might be helpful to see a circuit diagram. If you have a pull-down resistor with a logic HIGH applied you will have power loss through that resistor (for example your serial lines?)

 

Are there any other parts fitted on your custom PCB?

Just having the debugger connected adds additional power loss, even when the MSP is in LPM4.

For some reason, probably because I am new my reply to you seem to appear in the wrong place. So I will try again to insert my reply where I think it is right. I also attached the diagram as PDF attachment, I could not figure out how to make it appear nicely on the page.

 

Hi greeeg,

 

Thank you for your input. Attached please find the circuit diagram I use. I have no external pull down resistors at all.

All other parts on my PCB, like 4 LEDs and one buzzer are active only when the program is awake. When in LPM4 mode all LEDs outputs are set to HIGH and the Buzzer output is set to LOW , so no current should flow through these guys.

Regarding the RX, TX, RST and TEST pins , when I disconnect RX and TX there is no change in current consumption , still 75

430h2.pdf

Share this post


Link to post
Share on other sites

I might be wrong but all those INPUT_PULLDOWN might consume some power, so consider only enabling the pins you are using, which here would be P1_0 and P1_3.

After defining P1_0 as OUTPUT, you should give it a known state, like "digitalWrite(P1_0, LOW);".

 

Also, you might consider moving LPM4 to the end of setup() and leave loop() empty, or insert "while(1) {};" after calling LPM4.

Hi @Mention,

Thank you for your input. I have tried with and without all those INPUT_PULLDOWN but with no significant change in current consumption. I already tried to insert the LPM4 in different places including at the end of setup() but to no avail. 

Share this post


Link to post
Share on other sites

A reminder @@rord100 to not cross post in multiple forums. It only makes it harder for members to answer your question.

Hi ,

 

Sorry for the confusion I caused. Is there any way to cancel my post in one of the forums?

Share this post


Link to post
Share on other sites

Hi greeeg,

 

Thank you for your input. Attached please find the circuit diagram I use. I have no external pull down resistors at all.

All other parts on my PCB, like 4 LEDs and one buzzer are active only when the program is awake. When in LPM4 mode all LEDs outputs are set to HIGH and the Buzzer output is set to LOW , so no current should flow through these guys.

Regarding the RX, TX, RST and TEST pins , when I disconnect RX and TX there is no change in current consumption , still 75

Share this post


Link to post
Share on other sites

Hi,

Thank you, I did but to no avail, still same current consumption, But I realized that when I disconnect the TEST jumper from the Luanchpad the program stop running. Any Idea ?

Hi ,

This last problem is solved by connecting  the  RST pin on the target board to VCC. The high current consumption did not go away just yet...

Share this post


Link to post
Share on other sites

Hi guys,

 

I would like to report that following your comments I tried to set:   pinMode(P1_3,INPUT_PULLDOWN); instead of  the previous pinMode(P1_3,INPUT_PULLUP); and consequently I had to change  attachInterrupt(P1_3,Interrupt, RISING);instead of the the previous attachInterrupt(P1_3,Interrupt, FALLING);. I needed to change the switch  wiring  from GND to Vcc.

The results are that power consumption went from 75

Share this post


Link to post
Share on other sites

@@rord100

 

It isn't possible for others to replicate your findings since you are using a custom board with multiple things attached.  Can you recreate your findings on a G2 LaunchPad?  Try attaching the bells and whistles one thing at a time to isolate and see what might be causing it.

 

Since you are using Energia, have you tried the functions that it makes available?  i.e.  sleep(), sleepSeconds(), suspend() and wakeup()?  See for example this tutorial - it also demonstrates low power measurement with EnergyTrace and CCS.  Note that at this time CCS does not support Energia v18 so use an earlier version.

Share this post


Link to post
Share on other sites

P1_7, P1_6, P2_4, P2_3 are all connected to LEDs as your schematic shows.

 

If you are using pull-downs on these pins you will probably have a small current flowing through these LEDs.

Likely not enough to light them, but larger than the power drawn by the MSP430.

Share this post


Link to post
Share on other sites

Regarding the RST pin - typically the '430 devices want a pullup resistor between Vcc and RST.  If it's not on the board, the device won't run.  Also, your NC1-6 pins - are they all defined as PxOUT low and the PxDIR high? That's one  low power configuration for "unconnected pins" page 41 of the family user guide. slau144j.pdf

 

Secton 2.5 Connection of Unused Pins
The correct termination of all unused pins is listed in Table 2-3.

Px.0 to Px.7 Open Switched to port function, output direction or input with pullup/pulldown enabled
RST/NMI DVCC or VCC 47 k? pullup...

Share this post


Link to post
Share on other sites

P1_7, P1_6, P2_4, P2_3 are all connected to LEDs as your schematic shows.

 

If you are using pull-downs on these pins you will probably have a small current flowing through these LEDs.

Likely not enough to light them, but larger than the power drawn by the MSP430.

Hi Greeeg,

 

Thank you for your meticulousness and good comment. I changed the code accordingly  and the current consumption during LPM4 is now  ~ 0.29 ?A.

Attached bellow is the amended code:

void setup()
{
pinMode(P1_0,INPUT_PULLDOWN);   
pinMode(P1_1,INPUT_PULLDOWN);  
pinMode(P1_2,INPUT_PULLDOWN);  
        //pinMode(P1_3,INPUT_PULLDOWN);          This input will be set later 
pinMode(P1_4,INPUT_PULLDOWN);  
pinMode(P1_5,INPUT_PULLDOWN);  
pinMode(P1_6,INPUT_PULLUP);                  //LED  
pinMode(P1_7,INPUT_PULLUP);                 //LED  
  
pinMode(P2_0,INPUT_PULLDOWN);
pinMode(P2_1,INPUT_PULLDOWN);
pinMode(P2_2,INPUT_PULLDOWN);
// pinMode(P2_3,INPUT_PULLUP);            // LED This input will be set to   output
pinMode(P2_4,INPUT_PULLUP);              // LED connected
pinMode(P2_5,INPUT_PULLDOWN);         //  NC
pinMode(P2_6,INPUT_PULLDOWN);
pinMode(P2_7,INPUT_PULLDOWN);

pinMode(P1_3,INPUT_PULLDOWN); //I changed this from pinMode(P1_3,INPUT_PULLUP); 
pinMode(P2_3,OUTPUT);       //Enable output on P1_0 (onboard red LED) The P2_3 is where one of my LEDs is connected
attachInterrupt(P1_3,Interrupt, RISING); //I changed this  changed from attachInterrupt(P1_3,Interrupt, FALLING);
}

void loop()
{
  LPM4;     //whenever the loop runs, switch back into LPM4
                //we could put code here that would run after every Interrupt - see warning in text.
}

void Interrupt(void)   //Our interrupt routine
{
  digitalWrite(P2_3,!digitalRead(P2_3));  //toggle the red LED
};

Share this post


Link to post
Share on other sites

Regarding the RST pin - typically the '430 devices want a pullup resistor between Vcc and RST.  If it's not on the board, the device won't run.  Also, your NC1-6 pins - are they all defined as PxOUT low and the PxDIR high? That's one  low power configuration for "unconnected pins" page 41 of the family user guide. slau144j.pdf

 

Secton 2.5 Connection of Unused Pins

The correct termination of all unused pins is listed in Table 2-3.

 

Px.0 to Px.7 Open Switched to port function, output direction or input with pullup/pulldown enabled

RST/NMI DVCC or VCC 47 k? pullup...

Hi NurseBob

 

Thank you for your most educating remark. I was not aware of the family user guide. slau144j.pdf at all.

I changed my target board HW accordingly (attached bellow). I tied the RST pin to Vcc via a 47K resistor and the devise is running. I defined the GPIOs

as in the the code I previously posted to Greeeg above with current consumption of 0.29 ?A.

Is there anything else I can do, in your opinion  to lower current consumption to  0.1 ?A ?

Thank you

 

 

 

Low Power circuit.pdf

Share this post


Link to post
Share on other sites

@@rord100

 

It isn't possible for others to replicate your findings since you are using a custom board with multiple things attached.  Can you recreate your findings on a G2 LaunchPad?  Try attaching the bells and whistles one thing at a time to isolate and see what might be causing it.

 

Since you are using Energia, have you tried the functions that it makes available?  i.e.  sleep(), sleepSeconds(), suspend() and wakeup()?  See for example this tutorial - it also demonstrates low power measurement with EnergyTrace and CCS.  Note that at this time CCS does not support Energia v18 so use an earlier version.

Hi Fmilburn,

 

Thank you for your remark. I tried your example, in the  tutorial you mentioned  above, on a brand - new MSP-EXP430G Luanchpad with a Fluke 187 multimeter connected in series with the Vcc pins of J3 after the jumper was removed and the circuit consumed 0.22 ?A during suspend mode. which is nice.

Is there anything to do in your opinion  to lower current consumption to  0.1 ?A ?

 

Share this post


Link to post
Share on other sites

As on page 23 of the datasheet you should lower the voltage of your device as much as possible, probably to 1.8V to attain the lowest power consumption possible, as well as the temperature.

Even then, the typical current is 0.1uA, the max is 0.5uA.

Share this post


Link to post
Share on other sites

Somebody can correct me if I am wrong, but I seem to remember that the 20 pin G2553 has Port 3 internally, it just can't be accessed.  Accordingly, those should be pulled low also.  You will either have to add them to Energia in pins.h, or access the registers directly.  As roadrunner84 says, lowering the voltage and slowing down the clocks reduces power also.

Share this post


Link to post
Share on other sites

Somebody can correct me if I am wrong, but I seem to remember that the 20 pin G2553 has Port 3 internally, it just can't be accessed.  Accordingly, those should be pulled low also.  You will either have to add them to Energia in pins.h, or access the registers directly.  As roadrunner84 says, lowering the voltage and slowing down the clocks reduces power also.

If I remember correctly, the OP was in LPM4 - there shouldn't be any clocks... :)

On non-energia projects, even at 3.3V, I've seen my msp430F2013 at or below 0.1uA in LMP4.  Having not run similar code on a G2553, I don't know if the same holds true, though.

Share this post


Link to post
Share on other sites

 

If I remember correctly, the OP was in LPM4 - there shouldn't be any clocks... :)

On non-energia projects, even at 3.3V, I've seen my msp430F2013 at or below 0.1uA in LMP4.  Having not run similar code on a G2553, I don't know if the same holds true, though.

You are right of course about the clocks in LPM4.  I was thinking more in general I guess.  Almost all of my contraptions have needed to wake up on their own at intervals....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0