Part Number:MSP430FR58471
Hello,
I'm using MSP430FR59471IRHAT device. There is an interrupt defined on P2.2 input (the interrupt is produced on signal falling edge). When there are more than one consecutive pulses at P2.2, microcontroller produces series of multiple interrupts. I want microcontroller to produce an interrupt only for the first event. How can I prevent producing interrupts for all following input changes?
I've already tried to disable interrupts by clearing bit 2 in P2IFG register. It does not help.
Here is the relevant ISR code:
//Configuration of P2.2 input:
P2DIR &= ~BIT2; // Set P2.2 to input direction
P2IES |= BIT2; //interrupt flag is set on the falling edge of P2.2
P2IFG &= ~BIT2; //clear interrupt flag on P2.2
P2IE |= BIT2; //enable interrupt on P2.2
//-----------------------------------------------------------------------
// Port2 interrupt service routine
//-----------------------------------------------------------------------
#pragma vector = PORT2_VECTOR
__interrupt void PORT2_ISR (void)
{
//P2IE &= ~BIT2; //disable additional interrupts from P2.2 (does not disable further interrupts)
input1EventCounter++;
while(delayTimeCounter)
{
delayTimeCounter--;
}
P4OUT |= BIT1; //1 => set SW5_CMD to 'ON' state
P2IFG = 0; // clear all interrupt flags in P2IFG register
//P2IE |= BIT2; //re-enable additional interrupts from P2.2
} //end of the Port 2 interrupt routine