> while(B0!=1); What is connected to the other 7 bits of PORTB ? Since your setting in TRISB makes them all inputs, unless they are all wired to 0v then the above loop will NOT wait for you to press the button. You probably want to test just the bottom bit like this ... while((B0 & 1) == 0) ; Peter -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist