Jump to content
43oh

Msp430G2553 draws significant current at start up


Recommended Posts

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

Link to post
Share on other sites

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!

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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

Link to post
Share on other sites

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.

Link to post
Share on other sites
  • 2 weeks later...

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.

Link to post
Share on other sites

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. 

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