Hello,
I am trying to achieve low current in LPM3 on a MSP430G2332. Power supply is from battery CR2032. I am running a small SW below included. I measure current from pin 1 of the micro controller and current is > 50uA when LMP3 is activated. Actication time is about 1,5 second and current could be measured. According to specification it should be below 1uA, Why? Could you help me?
void LowPowerWait(unsigned int threeMilliseconds)
{
while(threeMilliseconds > 0)
{
CCR0 += 39;
threeMilliseconds--;
}
BCSCTL2 = SELM_0;
_BIS_SR(LPM3_bits + GIE);
}
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= BIT0+BIT1+BIT4+BIT5+BIT6+BIT7;
P1OUT &= ~(BIT0+BIT1+BIT4+BIT6+BIT7);
P1OUT |= BIT5;
P2DIR &= ~BIT6;
P2DIR |= BIT7;
P2OUT |= BIT7;
ADC10AE0 = BIT2;
unsigned int i=0;
int temp=0;
InitUSI();
DCOCTL = CALDCO_1MHZ;
BCSCTL1 = CALBC1_1MHZ;
TACCTL0 |= CCIE;
TACCTL0 &= ~CCIFG;
TACTL = TASSEL_1 + MC_2;
BCSCTL3 |= LFXT1S_2;
__bis_SR_register(SCG1 + SCG0);// Stop DCO
InterruptType = 3;
CCR0delta = 78;
CCR0 = TAR + CCR0delta;
__enable_interrupt();
while(1)
{
if(GetAdcValues() > 0) //Alway 0
{
…
}
else
{
LowPowerWait(498);
}
}
}
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A0(void)
{
TACTL &= ~TAIFG
__enable_interrupt();
if (InterruptType == 0)
{
LPM0_EXIT;
}
else
{
LPM3_EXIT;
}
CCR0 += CCR0delta;
}