sven222 1 Posted January 27, 2016 Share Posted January 27, 2016 Hi guys,on of the reasons for using the MSP430 is its ultra low power consumption but it is hard to find a short overview how to handle the IOs. My question is: If I go to LPM4 and only wake up through reset, how should I handle the IO Pins? Disconnect all pull ups/down? Make them input or output? My idea is, make them all outputs and write P1OUT and P2OUT to zero? Anything else important? I want to use a CR2032 and I think I do not need a power switch.Greetings Sven Quote Link to post Share on other sites
Rei Vilo 695 Posted January 27, 2016 Share Posted January 27, 2016 Please find an article about Ultra-Low Power with MSP430. This article discusses how to implement low power modes with Energia and how to measure with EnergyTrace. sven222 1 Quote Link to post Share on other sites
Fred 453 Posted January 27, 2016 Share Posted January 27, 2016 CCS is pretty good at giving you tips on power consumption. The Low Power Advisor should analyse your code when it compiles. You will get tips like setting unused pins to output and low. EnergyTrace++ on the later LaunchPads and MSP-FET let's you measure actual consumption very accurately. Personally, I wouldn't recommend Energia if you want fine control over power consumption and low power modes. Can you even get LPM4 with Energia? I'm not sure. Quote Link to post Share on other sites
Rei Vilo 695 Posted January 27, 2016 Share Posted January 27, 2016 Energia allows LPM3 and LPM4. See code in the article. Quote Link to post Share on other sites
spirilis 1,265 Posted January 27, 2016 Share Posted January 27, 2016 CCS is pretty good at giving you tips on power consumption. The Low Power Advisor should analyse your code when it compiles. You will get tips like setting unused pins to output and low. EnergyTrace++ on the later LaunchPads and MSP-FET let's you measure actual consumption very accurately. Personally, I wouldn't recommend Energia if you want fine control over power consumption and low power modes. Can you even get LPM4 with Energia? I'm not sure. Yes, LPM3 (sleep() and sleepSeconds()) and LPM4 (suspend()) and the ability for an ISR to request cancelling of an LPM3 sleep or LPM4 using wakeup(). Its delay() call also utilizes LPM0 and always has. Quote Link to post Share on other sites
LIJsselstein 9 Posted January 27, 2016 Share Posted January 27, 2016 You can definately go very low power using Energia. I currently have a setup with g2553 launchpad (with 32kHz crystal), DS1337 RTC, SPI flash chip and various other electronics hooked up (nearly all pins used) and it consumes about 3 uA @ 3.3V when waiting for interrupts and timing of actions in LPM 3. Besides software you will need to look carefully at the other chips and busses in your system. Quote Link to post Share on other sites
Fred 453 Posted January 27, 2016 Share Posted January 27, 2016 Energia allows LPM3 and LPM4. See code in the article. Fair enough. I quickly scanned the article on a small screen and only spotted LPM3. I do find it odd that when someone asks specifically about low power that you're directing them to Energia. Energia makes it a little less obvious what mode you're in - i.e. someone else's abstracted code handles it for you rather than setting it yourself. It doesn't do EnergyTrace - you have to go into CCS for that. If someone was already using Energia or struggling with CCS then fair enough, but why direct them away from a good IDE that they are already using to a less capable one that they're not familiar with? Quote Link to post Share on other sites
spirilis 1,265 Posted January 27, 2016 Share Posted January 27, 2016 Fair enough. I quickly scanned the article on a small screen and only spotted LPM3. I do find it odd that when someone asks specifically about low power that you're directing them to Energia. Energia makes it a little less obvious what mode you're in - i.e. someone else's abstracted code handles it for you rather than setting it yourself. It doesn't do EnergyTrace - you have to go into CCS for that. If someone was already using Energia or struggling with CCS then fair enough, but why direct them away from a good IDE that they are already using to a less capable one that they're not familiar with? Fair point, but TI has Energia debugging support in CCS now so you can use EnergyTrace/EnergyTrace++ from what I recall. Still, if a user comes in talking about P1OUT and P2OUT, chances are they're not an Energia user... Quote Link to post Share on other sites
cde 334 Posted January 27, 2016 Share Posted January 27, 2016 The MSP430x2xx family guide suggests: Px.0 to Px.7 OpenSwitched to port function, output direction or input with pullup/pulldown enabled Don't leave any floating input pins, don't leave them in a peripheral mode if you don't need them. They need to be set to a known state (Output low, Output high, or input with pullup/down). If they are connected to something, like an led, obviously if you want the led On, output high, otherwise output low (or Vis-versa if the led is tied to V+) to minimize that current draw. Ideally, any input pin should be set with the pull resistor that matches the normal state of the input, to reduce the draw through the pull-resistor. Even then, with the typical pull resistor value of 47k?, that's a 0.07 milliamp draw. 70 Microamps. See section 2.3-2.5 of the family guide http://www.ti.com/lit/ug/slau144j/slau144j.pdf Quote Link to post Share on other sites
sven222 1 Posted January 27, 2016 Author Share Posted January 27, 2016 Thanks for all your replies. Yes I am not an Energia User. The MSP430 is for me the possibility to learn about Quote Link to post Share on other sites
Fred 453 Posted January 27, 2016 Share Posted January 27, 2016 That looks OK to me a first glance. PxREN is ignored for outputs, but you might as well set it to something consistent. I'm not a Linux user, but I know TI does support Linux. You've probably seen this page, but just in case... http://processors.wiki.ti.com/index.php/Linux_Host_Support_CCSv6 CCS is based on Eclipse so if you have any quirks with your particular distro, maybe check for any tips to get Eclipse installed. Quote Link to post Share on other sites
yyrkoon 250 Posted January 27, 2016 Share Posted January 27, 2016 That looks OK to me a first glance. PxREN is ignored for outputs, but you might as well set it to something consistent. I'm not a Linux user, but I know TI does support Linux. You've probably seen this page, but just in case... http://processors.wiki.ti.com/index.php/Linux_Host_Support_CCSv6 CCS is based on Eclipse so if you have any quirks with your particular distro, maybe check for any tips to get Eclipse installed. It's not always easy setting up CCS in Linux unless you have prior experience with it. There are also instructions out there that are "bad" even from TI's website. Recently, I was setting up CCS6 for the Beaglebone, where the instructions were half 32bit, half 64bit . . . bad mojo . . . Anyway, Personally, I think using gcc is much better than using energia, or CCS. There is something to be said for a "consistent" compiler, and not being beholden to anyone . . . Does no one here use the gcc compiler any more? Quote Link to post Share on other sites
spirilis 1,265 Posted January 28, 2016 Share Posted January 28, 2016 It's not always easy setting up CCS in Linux unless you have prior experience with it. There are also instructions out there that are "bad" even from TI's website. Recently, I was setting up CCS6 for the Beaglebone, where the instructions were half 32bit, half 64bit . . . bad mojo . . . Anyway, Personally, I think using gcc is much better than using energia, or CCS. There is something to be said for a "consistent" compiler, and not being beholden to anyone . . . Does no one here use the gcc compiler any more? Every Energia user is using gcc! but the old pabigot mspgcc... (installing Energia is also the stupid-simplest way to get a gcc + flashing toolchain going btw, and for ARM it does use the launchpad.net arm-none-eabi-gcc) The new msp430-elf-gcc that ships with CCS et al is still a bit buggy from what I recall. A new release came out recently that's still considered "beta" but I believe @@Rickta59 found some truly boneheaded ASM output it was producing for something I don't quite recall. Something about requiring a function call for shifting bits when it could do it inline I think. yyrkoon 1 Quote Link to post Share on other sites
yyrkoon 250 Posted January 28, 2016 Share Posted January 28, 2016 Every Energia user is using gcc! but the old pabigot mspgcc... (installing Energia is also the stupid-simplest way to get a gcc + flashing toolchain going btw, and for ARM it does use the launchpad.net arm-none-eabi-gcc) The new msp430-elf-gcc that ships with CCS et al is still a bit buggy from what I recall. A new release came out recently that's still considered "beta" but I believe @@Rickta59 found some truly boneheaded ASM output it was producing for something I don't quite recall. Something about requiring a function call for shifting bits when it could do it inline I think. Well, I'm not exactly a big fan of energia . . . but I've used the toolchain with code:blocks in the past. I think your statement flashing toolchain going btw, and for ARM it does use the launchpad.net arm-none-eabi-gcc) deserves a bit of clarification. Cortex *M* processors, perhaps. Not Cortex A8 etc, such as what is used on the beaglebones. It's a completely different toolchain. Anyway, I do not like the energia editor / IDE, or whatever one would like to all it. The toolchain is probably fine. But I think like sven eluded to. Ubuntu, and perhaps other distro's can install the msp430 toolchain really easily. Ubuntu also has packages for armel, armhf, and all the different variants of eabi-none as well. They all work flawlessly out of the box from what I've seen. Quote Link to post Share on other sites
sven222 1 Posted January 28, 2016 Author Share Posted January 28, 2016 CCS for linux is realy a desaster. Nothing seems to be tested. The next thing is, that I am also not the biggest fan of eclipse, cause it is to heavy for an IDE. I prefer a silent computer and not a fan running on max speeb, only because I use a text editor. The enrgia editor is also not very comfortable. The toolchain of it is very comfortabel, so that is the easyest way to go. OK, discussion moved away from the original theme, but that was also solved. Thanks for all your help. Greetings Sven Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.