Jump to content
43oh

rord100

Members
  • Content Count

    17
  • Joined

  • Last visited

Posts posted by rord100

  1. @@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 tested your suggested code on new MSP-EXP430G using Fluke 187 multimeter connected in series to the Vcc pins of J3 after the jumper was removed and I measured 0.27 ?A which is good.  Is there anything else I can do, in your opinion,  to lower current consumption to  0.1 ?A ?

     

    Here is your the code I used:

    
    /* 
      This example was derived from a posting by  fmilburn3 
      Demonstrates a way to utilize LaunchPad low power modes with the
      sleep(), sleepSeconds(), suspend() and wakeup() functions in
      Energia. The LaunchPad will blink the red LED 3 times and 
      demonstrate sleep() and sleepSeconds().  It then goes into suspend()
      but will wake up and start over again if the button is pushed.
      sleep() and sleepSeconds() use LPM3. suspend() uses LPM4.
      This example was derived from a posting   by @[member=spirilis] at 43oh.com
      Created by Frank Milburn June 2015
      Released into the public domain
    */
    void setup()
    { 
        for (int i =2; i < 20; i++)
    {
    pinMode(i, OUTPUT);
    digitalWrite(i, LOW);
    }
     
    pinMode(P1_3,INPUT_PULLUP);       // this is the PUSH BUTTON
    pinMode(P1_0,OUTPUT);                     //Enable output on P1_0 (onboard red LED) 
    attachInterrupt(P1_3,Interrupt, FALLING); 
    }
    
      void loop()
    {
    // Flash the LED - use sleep and sleepSeconds to save power by going
    // into LPM3
      for (int i = 0; i < 3; i++)           
      {
        digitalWrite(RED_LED, HIGH);
        sleep(200);                        // use sleep for millis
        digitalWrite(RED_LED, LOW);
        sleepSeconds(1);                   // use sleepSeconds for seconds
      }
      // Suspend and go into LPM4
      suspend();
    }
    void Interrupt(void) 
    {
      wakeup();                            // wake up if button is pushed
    }
    
  2. @@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 ?

     
  3. 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

  4. 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
    };
    
  5. 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

  6. 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

  7. 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. 

  8. 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

  9. 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

  10. Hi @Mention,

     

    Thank you for your advise. It is a very enlightening article which I read with great interest.  I studied  the practices mentioned at the "Ultra-Low Power with MSP430" link and successfully used the codes they suggested. Although I used their codes, I did not use their measuring method but instead I used analog method, namely, connected a micro Amper meter in series with the VCC line. I used different high quality ?A meters, they all show similar results.

    The code is working, the current goes from 5mA when in awake mode to 75 ?A when in LPM4 mode. I failed to understand what

    did I do wrong not being able to reach 1?A like they did. The TI MSP430G2553 datasheet indicates to use 2.2VDC of supply voltage where they mentioned 0.1?A current consumption. I was tempted to go down  this road when I realized that in the link you mentioned they reached this current consumption using Vcc~3.6VDC. Presently I am a bit confused..... and will appreciate a good hint,  thank you
     

  11. 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
    };
  12. A basic sketch could look something like the following:

    void setup()
    {
      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
    };
    
     

    The above code will toggle the onboard red LED everytime the button is pressed.

     

    The code goes through the normal setup routine, which is pretty self explanatory. When it goes into the loop the first thing it gets is the command to switch to Low Power Mode 4. The processor now goes into a deep sleep until an interrupt occurs.  When you press the button, the processor wakes up and executes the code in the Interrupt() function - in this case just toggling the red led.  After the interrupt finishes, the processor should go back into sleep, however Energia has a timer that handles things like millis() that also wakes up with the return from the interrupt. This timer calls an interrupt, which leaves the processor running when it finishes. The processor will continue to run from the next command after LPM4 in loop(). In the above example, there is no more code, so loop() will start again, it gets to the LPM4 instruction and goes to sleep.

     

     

    If you will be using low power modes, I recommend going into the Energia "cores" folder, finding the file WInterrupts.c, and adding the command "LPM4_EXIT;" to the end of each of the interrupt handlers in that file. This will guarantee that the processor will always be left in the "awake" state after an interrupt runs, and doesn't make it dependent on Energia's timer. Without this change, if for some reason Energia's timer was stopped when you go into LPM4, there is no way to leave the processor awake after an interrupt.

     

    To minimize current consumption, you should also configure any unused pins as INPUT_PULLDOWN.  From the tests I have done, configuring all pins to INPUT_PULLDOWN will reduce current to below 0.1uA (on my meter it flickers between 0 and 0.1). Configuring unused pins to INPUT_PULLUP or OUTPUT will result in the meter showing a consistent 0.1uA, while leaving the pins at their default (equivalent to INPUT) resulted in random current consumption in the 200-500uA range.

    @@grahamf72

     

    Hi,

     

    I followed this conversation with great  interest. I have a similar setup, namely, 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 ) microAmper meter and GND. I tried the recommended  sketch 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 microampers instead of the desired ~ 0.1 microamp.

     

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

     

    Thank you

     

    @rord100

×
×
  • Create New...