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.

Debouncing code

Hi,

I am getting a noise on Edge triggered interupt. Below is the code for that. I make a decesion SwitchedACCycleDetected = 1; on every edge detected. 
But some times noise getting edge triggered making my variable SwtichedACCycleDeteced = 1. 
Can somebody  send me debouncing code for edge triggered interrupt.
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
INT++;
P1IFG &= ~BIT2;
SwitchedACCycleDetected = 1;
SwACDetection = 0;
}

Thanks,

**Attention** This is a public forum