I started out using the sample code from the piclist FAQ - Detecting bit changes. I was unable to get it to fit in a loop and work out for me, so this is what I came up with. It seems to be working fine. Since this is my first project, I wanted to put this up for critique and if it is fine, for the next newbie to find. Pressing a button on RB4 will turn on a LED on RB5. Releasing button turns off. __________________________ Scan_Keys: movf PORTB,w ; movwf scratchpad ;put PORTB in a temp register xorwf keys,w ;compare to last rounds winners btfsc STATUS,Z ;Z=0 if same return ;same - go back comf keys,w ; andwf scratchpad,w ; andlw b'00010000' ;only worried about the input of RB4 btfss STATUS,Z ; goto rb4on ; goto rb4off ; rb4on: call tenmsdlay ;a 10 millisecond delay btfsc PORTB,4 ;see if it is still running bsf PORTB,5 ;yep - so set it btfsc PORTB,4 ;needs work bsf scratchpad,5 ;set bit in scratch too goto sav_keys ;pick up added activations rb4off: bcf PORTB,5 ; bcf scratchpad,5 ; goto sav_keys ;pick up new port settings sav_keys: movf scratchpad,w ; movwf keys ;store new keys return ____end of code snippet**** -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics