Jump to content
atdt

LPM3 with Energia EMT and MSP432

Recommended Posts

I was wondering if anybody has been able to get LPM modes working with Energia EMT and the MSP432. 

 

I have tried a few things, but have been unsuccessful in lowering the current draw of the MSP432.

 

Any insights would be appreciated.

 

Thanks!

Share this post


Link to post
Share on other sites

That is what I thought as well, but it only drops to 90 mv in delay (versus 100 when running). Sleep isn't supported, but the documentation says that delay will work in the place of sleep - I am just not seeing it with a real-world test.

 

The LPM3 for MSP432 claims it can get to 850nA in LPM3, but I am far from seeing that with just a delay in the loop and nothing else. My tests show it being off by an order of magnitude.

 

I am open for testing. My next steps will be to use code composer to put it into LPM3, and measuring that directly, but I am hoping for more information first.

 

Thanks!

Share this post


Link to post
Share on other sites

Whoops, I just noticed that I mistyped - it should have read that the board drops to 90 mA in delay. Also, the board itself is a board I developed, so it just has the bare necessities for the MSP432 to run. It is not the development board.

 

Thanks!

Share this post


Link to post
Share on other sites

For the record, I just tested a basic program in CCS, and the draw was 2mA. Here is the app I ran:

#include "msp.h"
void main(void){
    WDTCTL = WDTPW | WDTHOLD;           // Stop watchdog timer
    while(1) {
        for(i=10000; i>0; i--);         // Delay
    }
}
 
I wrote this test in Energia, with a power draw of 140mA. 
void setup(){
  delay(10);
}
void loop(){
  delay(1000);
}

I am trying to understand the significant difference in power draw between the two applications. For the Energia sketch, I loaded it to a custom board using UniFlash (flashing the ELF). For the CCS, I loaded the .out using UniFlash.

 

Thanks for any assistance.

Share this post


Link to post
Share on other sites

Just to expand on this a little more. If I import an Energia project into CCS, it will still consume between 140 and 160 mA. If I write native c in CCS, I am looking at sub 2mA (which I would expect to see).

 

It appears to be something in the underlying Energia libraries which is overriding the lower sleep level. I am open to ideas if anybody has any. My next thought will be to start stripping out individual libraries and seeing if that has any effect.

Share this post


Link to post
Share on other sites

Try sleep().

 

Unfortunately, sleep isn't supported by the MSP432 yet (it won't compile). The Energia documentation I have found has indicated that delay is similar to LPM3 sleep.

 

The documentation I am referring to is here: http://energia.nu/energia-mt-for-msp432/

And this is the relevant section: "For example, if you use a delay(500) at the end of your loop instead of ticking for 500 milliseconds, TI-RTOS will set an interrupt and go into deep sleep until the 500 milliseconds is up."

Share this post


Link to post
Share on other sites

No idea, but anything above 5-10mA with the CPU fully active and crunching numbers sounds ... suspiciously high?  Are you sure it isn't some other circuit within your project that's drawing that much current?  (sleep mode naturally would have no effect on that)

Share this post


Link to post
Share on other sites

I am confident in my board because I can flash a LPM3 binary (written in CCS) from CCS and see less than 2mA. That leads me to believe the problem is in an underlying Energia library.

Share this post


Link to post
Share on other sites

I am confident in my board because I can flash a LPM3 binary (written in CCS) from CCS and see less than 2mA. That leads me to believe the problem is in an underlying Energia library.

That's great, but is 140-160mA a typo (order of magnitude off) or legit?  That's crazy high for an MCU not asleep running at full throttle...

Share this post


Link to post
Share on other sites

I measured it at 140 (not a typo). I am not at the lab today, but when I get back to the office I will pull a reading from the development board as well to cross check a native CCS app versus an Energia sketch and compare that way. Good idea! Thanks!

Share this post


Link to post
Share on other sites

I programmed the following into a MSP-EXP432P401R LaunchPad with Energia V17

void setup(){
  pinMode(RED_LED, OUTPUT);
}

void loop(){
  float f;
  digitalWrite(RED_LED, HIGH);
  for(f = 0; f < 720; f = f + 0.0001){
    sin(f);
  }
  digitalWrite(RED_LED, LOW);
  delay(3000);
}

So it wastes time in a loop doing floating point and burning the red LED for a couple of seconds. Then it goes into a 3 second delay.

Then I unplugged it, and removed the 3.3V and 5V isolation jumpers between the emulator side of the LaunchPad and the MSP432. I used another LaunchPad to power the MSP432 LaunchPad from the 3.3V and GND pins on the MSP432 side with a 1.5 ohm (measured) resistor in the middle. Then I read the voltage drop across the 1.5 ohm resistor with my cheap DMM as the program ran.

The results are as follows:
post-45284-0-57742800-1457121740_thumb.jpg
When it is not in the delay and the LED is on I read 18.3 mV. So, current is 18.3/1.5 = 12.2 mA. The MSP432 uses 90 uA per MHz when active per the datasheet or 4.3 mA at 48 MHz. The LED is probably using around 10 mA, so in the ballpark.
post-45284-0-77282200-1457121883_thumb.jpg
This arrangement can't see any voltage drop when the delay is on and the LED goes off (less than a mA). I put it on my oscilloscope and see essentially the same thing. So something about your arrangement or measurement seems to be off.

 

EDIT: Reposted the Energia code so that it can be read.  Also, to clarify, it looks from my experiment that delay() does put the MSP432 into LPM on the LaunchPad.  When you figure out why you are getting different results, let us know.

Share this post


Link to post
Share on other sites

I think I finally figured it out. It appears that others have seen this behavior as well, and that it indicates a non working MSP432: https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/449768#pi316701=2

 

Because of the whole revision A/B happening right now, I won't have new boards to test from the fab for a few weeks. But I am looking forward to.

 

Thanks to everybody for their help

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...