fabo9573 3 Posted January 14, 2016 Share Posted January 14, 2016 Hi, my name is Fabian an im recently working on an MSP430 project with the Launchpad MSP-EXP430G2 and Energia 0101E0017. I have an TEG Harvester and want to run the MSP that sends data via a NRF24l01 module. Everything works great, current is really low in working and in sleeping mode. But now the problem: When i apply power to the chip (3,3V) it draws significant current for about 2 seconds. Then it starts working normal and the current drops and stays low as long as you don't remove the supply and start again. This is really bad for energy harvesting applications, because you need a much bigger harvester just because of that power up current that just happens sometimes. Is there a setting for the startup time? Please see my attached code. Thank you so much, Fabian PPEH.ino Quote Link to post Share on other sites
bluehash 1,581 Posted January 14, 2016 Share Posted January 14, 2016 Hi, my name is Fabian an im recently working on an MSP430 project with the Launchpad MSP-EXP430G2 and Energia 0101E0017. I have an TEG Harvester and want to run the MSP that sends data via a NRF24l01 module. Everything works great, current is really low in working and in sleeping mode. But now the problem: When i apply power to the chip (3,3V) it draws significant current for about 2 seconds. Then it starts working normal and the current drops and stays low as long as you don't remove the supply and start again. This is really bad for energy harvesting applications, because you need a much bigger harvester just because of that power up current that just happens sometimes. Is there a setting for the startup time? Please see my attached code. Thank you so much, Fabian Probably an initial current surge used by the regulators on the LP. How are you powering it? You can use the J6 3.3V header on the LP to power the 2553 externally Also.. a pic of the TEG would be nice to see! fabo9573 1 Quote Link to post Share on other sites
spirilis 1,265 Posted January 14, 2016 Share Posted January 14, 2016 No most likely the Energia core polling to check for the presence of the LFXT1 32.768KHz crystal. Is that soldered on, or could you add it? fabo9573, bluehash and energia 3 Quote Link to post Share on other sites
fabo9573 3 Posted January 14, 2016 Author Share Posted January 14, 2016 Hi, Thanks for your quick reply, really appriciate that. I don't use any regulators, i disconnetcted the programmer with the jumpers J3. I power it from a big cpapcitor, see the attached picture. 1000 bluehash 1 Quote Link to post Share on other sites
spirilis 1,265 Posted January 14, 2016 Share Posted January 14, 2016 Hi, Thanks for your quick reply, really appriciate that. I don't use any regulators, i disconnetcted the programmer with the jumpers J3. I power it from a big cpapcitor, see the attached picture. 1000 Quote Link to post Share on other sites
spirilis 1,265 Posted January 14, 2016 Share Posted January 14, 2016 Edit hardware/msp430/cores/msp430/wiring.c, look for enableXtal(): #ifdef __MSP430_HAS_BC2__ /* LFXT can take up to 1000ms to start. * Go to the loop below 4 times for a total of 2 sec timout. * If a timeout happens due to no XTAL present or a faulty XTAL * set ACLK source as VLO (~12kHz) */ uint16_t timeout = 0x4; do { timeout--; /* Clear Oscillator fault flags */ BCSCTL3 &= ~LFXT1OF; /* Clear the Oscillator fault interrupt flag */ IFG1 &= ~OFIFG; /* @ 1MHz startup: delay for 500ms */ __delay_cycles(500000L * (F_CPU/1000000L)); if(!timeout) break; /* Test the fault flag */ }while (IFG1 & OFIFG); /* If starting the XTAL timed out then fall back to VLO */ if(!timeout) { /* ACLK = VLO = ~ 12 KHz */ vlo_freq = 12000; /* No XTAL present. Default P2.6/7 to GPIO */ P2SEL &= ~(BIT6|BIT7); /* Source ACLK from VLO */ BCSCTL3 |= LFXT1S_2; } After uint16_t timeout = 0x4, set timeout to 0 (or just change that line to "uint16_t timeout = 0;", then comment out or delete that entire do { ... } while(IFG1 & OFIFG); block. That'll shortcut it into assuming it has to use VLOCLK and stop the busy-wait. energia 1 Quote Link to post Share on other sites
fabo9573 3 Posted January 14, 2016 Author Share Posted January 14, 2016 Hi spirilis, Thank you! That indeed did make a big change. But still there is some quite high initial current, not 2 seconds anymore but about 1 second now. Is there a way to get rid of that, too? Thank you so much, Fabian Quote Link to post Share on other sites
spirilis 1,265 Posted January 14, 2016 Share Posted January 14, 2016 Hi spirilis, Thank you! That indeed did make a big change. But still there is some quite high initial current, not 2 seconds anymore but about 1 second now. Is there a way to get rid of that, too? Thank you so much, Fabian So you soldered it on? Keep in mind it still does take time to initialize, and enableXtal() will busy-wait poll during that timeframe. Quote Link to post Share on other sites
fabo9573 3 Posted January 14, 2016 Author Share Posted January 14, 2016 Hi spirilis, Ok, i just commented out the wrong thing! Now it works! Thank you so much! Really appriciate this amazingly fast help! Just shocked how low the consumption really is. I did a lot of things before with the Cypress PsoC (1 and 4) but the MSP is just way better in power consumption. Not gonna be the last project! Thank you again, Fabian bluehash and abecedarian 2 Quote Link to post Share on other sites
spirilis 1,265 Posted January 14, 2016 Share Posted January 14, 2016 Hi spirilis, After commenting out the do while, it draws more current. It now only works with the powersupply. The capacitor gets discarged till 1.3 V. I did make a change in the board file before, i changed F_Cpu from 16000000 to 1000000; Maybe thats the reason? And yes, i did solder the 32khz crystal. Thank you, Fabian Ok if you have the XTAL installed don't change that routine or comment out the do/while stuff... maybe tighten it up a bit: uint16_t timeout = 20; and for the do/while loop's __delay_cycles, use: __delay_cycles(100000L * (F_CPU/1000000L)); That might take a little less time. Still will busy-wait though. Just no way around that here IIRC. abecedarian 1 Quote Link to post Share on other sites
pmcalabrese 0 Posted January 23, 2016 Share Posted January 23, 2016 I've a similar issue. I need to reduce the bootstrap time, I've measured with a logic analyzer the time between power up and the output of the tone() function output and I have appox 2.5 seconds. Now, I've followed the instruction about comment out some of the code in the wiring.c file but did not work still 2.5 seconds. Any suggestions? I'm using Energia 17 and running. Quote Link to post Share on other sites
Frida 4 Posted January 24, 2016 Share Posted January 24, 2016 Try Energia 12, something happened in the newer versions. Quote Link to post Share on other sites
energia 485 Posted January 25, 2016 Share Posted January 25, 2016 In Energia 12 there was no power management and hence you will see faster startup times but you will only get very limited low power support. If you do not have a external 32.768kHz Crystal installed and don't plan to install one and you are using a G2 MSP430 then you need to change the enableXtal() from: #ifdef __MSP430_HAS_BC2__ /* LFXT can take up to 1000ms to start. * Go to the loop below 4 times for a total of 2 sec timout. * If a timeout happens due to no XTAL present or a faulty XTAL * set ACLK source as VLO (~12kHz) */ uint16_t timeout = 0x4; do { timeout--; /* Clear Oscillator fault flags */ BCSCTL3 &= ~LFXT1OF; /* Clear the Oscillator fault interrupt flag */ IFG1 &= ~OFIFG; /* @ 1MHz startup: delay for 500ms */ __delay_cycles(500000L * (F_CPU/1000000L)); if(!timeout) break; /* Test the fault flag */ }while (IFG1 & OFIFG); /* If starting the XTAL timed out then fall back to VLO */ if(!timeout) { /* ACLK = VLO = ~ 12 KHz */ vlo_freq = 12000; /* No XTAL present. Default P2.6/7 to GPIO */ P2SEL &= ~(BIT6|BIT7); /* Source ACLK from VLO */ BCSCTL3 |= LFXT1S_2; } #endif to: #ifdef __MSP430_HAS_BC2__ /* ACLK = VLO = ~ 12 KHz */ vlo_freq = 12000; /* No XTAL present. Default P2.6/7 to GPIO */ P2SEL &= ~(BIT6|BIT7); /* Source ACLK from VLO */ BCSCTL3 |= LFXT1S_2; #endif This should significantly reduce your startup time but bare in mind that sleep() and sleepSeconds() won't be very accurate. I would recommend to install the external 32.768kHz that comes with the LaunchPad. Quote Link to post Share on other sites
pmcalabrese 0 Posted January 25, 2016 Share Posted January 25, 2016 @@energia thanks for yout answare. I've tried the changes you suggested, but did not change nothing. As you can see here. https://goo.gl/photos/6uMfp6n7m1sb1W6g6 I've no 32KHz quartz and Energia 17. 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.