heerbommel 0 Posted October 16, 2016 Share Posted October 16, 2016 Hi to all, I am new with low power modes and therefor I want to use this forum for an initial project. It will be a kids toy. Just a MSP430G2553, two AA-batteries, one LED and a pushbutton. If you press the pushbutton than the LED will light up. If you press the pushbutton again than the LED will switch off. If the LED is on for a about 1 minute than the LED will be turned off. Another push on the button will turn on the LED etc. The code for the task above is not a bis problem. But I want the controller to send in sleep mode while waiting for another push of the button. And I have no clue... Thank you for your help! Ade, STEFAN. Quote Link to post Share on other sites
cubeberg 540 Posted October 16, 2016 Share Posted October 16, 2016 I'd suggest downloading the code examples from the product page - http://www.ti.com/product/MSP430G2553/toolssoftware (download link - http://www.ti.com/lit/zip/slac485) There are a lot of examples depending on what particular aspect you're looking for. Here are a couple of examples that might be helpful: msp430g2xx3_P1_04.c - toggle LED when button pushed - using LPM4 msp430g2xx3_lpm3_vlo.c - LPM3 - LED toggled every 6 seconds Quote Link to post Share on other sites
roadrunner84 466 Posted October 17, 2016 Share Posted October 17, 2016 I made this exact setup a few years back. I actually used two buttons and two LEDs, and I embedded it in a toy kitchen. If I remember correctly, I used an msp430g2230 for the task, that's an 8 pin msp430. I did not use Energia for this project, but IAR, similar to CCS. There were some extra features, for example the LEDs were pulsed, and the pulses of the LEDs were 180 out of phase as to load the battery as evenly as possible. I used both LPM3 and LPM4 for this task; while an LED was on, I went to LPM3 to allow a timer to keep running. Then when the timer expired (and thus the LEDs are turned off) I go to LPM4 which should use about 200nA on that processor. I don't know if it is really that low, I don't own a nanoamp meter. Quote Link to post Share on other sites
heerbommel 0 Posted October 17, 2016 Author Share Posted October 17, 2016 Thank you cubeberg, I have to use Energia to code. Quote Link to post Share on other sites
cubeberg 540 Posted October 17, 2016 Share Posted October 17, 2016 I have to use Energia to code. Well, I know there's a way to go into low power in Energia - might be a good idea to post in the Energia forum. Attach Interrupt would take care of the button push part and Sleep looks like it would work for low power/timing portion - but I don't use Energia a lot outside of ARM chips. Quote Link to post Share on other sites
Fmilburn 446 Posted October 17, 2016 Share Posted October 17, 2016 For energia look at this example: https://github.com/fmilburn3/Energia_LPM Quote Link to post Share on other sites
Rei Vilo 695 Posted October 17, 2016 Share Posted October 17, 2016 See also Ultra-Low Power with MSP430 with EnergyTrace delay() vs. sleep() suspend() and wakeup() Quote Link to post Share on other sites
heerbommel 0 Posted October 21, 2016 Author Share Posted October 21, 2016 Thanks to all! I will try to build my ( ) little toy and I hope it will work. 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.