Thank You. Now is working OK! Here is finally code. P1OUT |= (ENC_UP_A + ENC_UP_B + ENC_DOWN_A + ENC_DOWN_B); P1REN |= (ENC_UP_A + ENC_UP_B + ENC_DOWN_A + ENC_DOWN_B); P1IFG &= (~ENC_UP_A + ~ENC_DOWN_A); P1IE |= (ENC_UP_A + ENC_DOWN_A); #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { if(P1IFG & ENC_UP_A) { if(P1IN & ENC_UP_B) { Up_ENC_step_R(); } else { Up_ENC_step_L(); } P1IFG &= (~ENC_UP_A); } if(P1IFG & ENC_DOWN_A) { if(P1IN & ENC_DOWN_B) { Down_ENC_step_R(); } else { Down_ENC_step_L(); } P1IFG &= (~ENC_DOWN_A); } }
↧