Hi,
I need to check the power consumption of MSP430F413 in low power
modes LPM3 and LPM4,I have written a code in which the MSP430 goes
to LPM3,4 if the switches s1,s2 are pressed.
The LED glows properly if I press switch but the power consumption
at both modes are same(0.6uA).
If anybody has an idea about how to correct the below prog please
help me..
//Program to check the low power modes LPM3,LPM4 MSP430F413
#include
void main()
{
WDTCTL = WDTPW +WDTHOLD; // Stop WDT
//reset all the port
P1DIR=0x01; // Set P1.0 to output direction
//pushbutton S1
P1DIR &= ~0x08; //P1.3 Input for interrupt
P1IES |= 0x08; //P1.3 interrupt edge high to low
P1IE |= 0x08; //Enable P1.3 interrupts
//pushbutton S2
P1DIR &= ~0x10; //P1.4 Input for interrupt
P1IES |= 0x10; //P1.4 interrupt edge high to low
P1IE |= 0x10; //Enable P1.4 interrupts
_EINT(); // Enable interrupts
while(1);
}
//interrupt handler
#pragma vector=PORT1_VECTOR
__interrupt void PORT1 (void)
{
P1IFG &= ~0x08; //Clear interrupt flag
P1IFG &= ~0x10; //Clear interrupt flag
// PORT PIN 1.3 PUSH BUTTON S1
if((P1IFG & 0x08)==0)
{
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
_BIS_SR(LPM3_bits+ GIE); // Enter LPM3 w/ interrupts
}
// PORT PIN 1.4 PUSH BUTTON S2
if((P1IFG & 0x10)==0)
{
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
_BIS_SR(LPM4_bits+ GIE); // Enter LPM3 w/ interrupts
}
}
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )