This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Hardware interrupts in msp430g2553?

Other Parts Discussed in Thread: MSP430G2553

Hi,
   I got a program for hardware interrupt. the program is about toggling the LED1 upon interrupt. I am currently using the msp430g2553. The msp doesnot initiate the ISR upon pressing the switch S1. My code is given below.

#include<msp430g2553.h>

void main(void)
{
    WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
    P1DIR |= 0x01; // Set P1.0 to output direction
    P1OUT |= 0x01; // LED1 on
    P1IE |= BIT3; // P1.3 interrupt enabled
    P1IES |= BIT3; // P1.3 Hi/lo edge
    P1IFG &= ~BIT3; // P1.3 IFG cleared

    _BIS_SR(LPM4_bits + GIE); // Enter LPM4 w/interrupt
}

// Port 1 interrupt service routine
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
    P1OUT ^= 0x01; // P1.0 = toggle
    P1IES ^= BIT3;
    P1IFG &= ~BIT3; // P1.3 IFG cleared
}

P1.0 is the LED
P1.3 is the switch
Can anyone suggest me on this?
Is the code right?

**Attention** This is a public forum