Hi, i am new with msp430.
Im trying to toggle just selcted pin.But when a pin is active high and when i xor another one, first pin gets low.I just want to toggle only selected pin.
Here is my code
P1DIR = BIT0+BIT5+BIT6+BIT7; //leds
P1OUT=0x00;
P1IE = BIT4;
P1IES=BIT4; //falling edge
__enable_interrupt();
while(1){ }
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
counter++;
if(countery==1){startTimer();
P1IFG = ~BIT4; }
else if(counter==2){stopTimer(); time=readTimer(); clearTimer(); counter=0; ;
}
if(time>7000&& time<8000){ P1OUT ^= BIT0; __delay_cycles(50000);
P1IFG = ~BIT4;
else if(time>13500&& time<15000){ P1OUT ^= BIT5; __delay_cycles(50000);
P1IFG = ~BIT4;
}
} }