1

i am working on a project in msp430f2274 microcontroller. In my project i am trying to read an reed switch which is being connected to a GPIO pin at P2.3. Normally the pin will remain HIGH as it is being connected to pull up from the hardware. when once the switch is pressed/activated a LOW will come and it will trigger the Hardware. till here it is working fine. but now i want to read the other interrupt also, when it goes back to high. I have tried the interrupt type from low - high to high -low in ISR but still no efffect. please help. i have added ISR from the code

 static char x=0;
#pragma vector=PORT1_VECTOR 
__interrupt void PORT1_ISR(void)
{
 P1IES^=BIT2;
 P1OUT^=(BIT0);           // enrer the rest code for detection of door open      or close.
     P1IFG &= ~BIT2;    
     //P1IES&=~BIT2;
   __bis_SR_register_on_exit(GIE+LPM0_bits); // Enter LPM3 on ISR exit    

}

1 Answers1

0

Just an idea, sry if this doesn't help. You could use a timer that starts with the button click and triggers an interrupt when the button is released.

SamY
  • 78
  • 10