Hi all, /* sbit BTN1 at RB1_bit; sbit PROT at RB2_bit; sbit TEST at RB3_bit; void main() { TRISB =3D 00001110; PORTB =3D 00001010; PROT =3D 0; if( BTN1 =3D=3D 0){ PROT =3D ~PROT } */ BTN1 is active high and when pressed it shorts the pin to ground. But when I run the test code above, PROT converts into its complement even if the button is not pressed. Also when I type if(BTN1 !=3D 1) instead of if(BTN1 =3D=3D 0), all logic levels are drawn to low, not responsive. It's a very annoying thing, has anyone encountered such a behavior ? --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .