> Unfortunately now the LED does not turn on, the reverse > of what I had originally Suggestion 1 Get two circuits, one doesn't turn on, one doesn't turn off, look at them with alternate eyes. Make a game of it - see how fast you can go before people ask if you're OK (or walk quickly away tapping their heads and tut-tutting) Suggestion 2 Add a delay before the btfsc. It's possible that the pin comes up to 1 very slightly after there's enough Vcc for the PIC to run and so the btfsc is immediately true Anything will do - start clrf temp ;short delay (770 cycles) bump incfsz temp goto bump (or goto $-1) btfsc PORTA, 1 ;wait for a.1 to ground goto $-1 ;loop back to the btfsc movlw 04h ;Turn on the LED ;which will be more useful to you in the future as ; ; movlw b'00000100' ;turn porta.2 on movwf PORTA ;perhaps a short debounce delay - could be longer incfsz temp ;temp already = 0 goto $-1 btfss PORTA,1 ;is RA.1 high? goto $-1 ;no, loop movlw b'00000000' ;turn porta,2 off movwf porta Instead of using all of the bits in porta, this is better. Up in your definitions/constants section before "Start" add #define switch porta,1 #define led porta,2 Now you can use bsf and bcf instructions bsf led ; = turn porta,2 on bcf led ; = turn porta,2 off The alterrnative is to read porta, AND or OR the bit, then write the byte back to porta. bsf/bcf does it for you Similarly btfsc switch ;look for switch = 0 btfss switch ;look for switch = 1 -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu