It's easier to read and more informative to use includes and an itemised CONFIG statement include "P16F628.inc" will allow you to use the standard Microchip register and bit names and example CONFIG __CONFIG _CP_OFF & _HS_OSC & _WDT_OFF & _PWRTE_OFF & _BODEN_OFF & _LVP_OFF shows what is actually set on/off in CONFIG. Without going through the bit assignments in the include file I've no idea what you want CONFIG to be doing with 3F10 or 3D10. The problem could be there or with CMCON. The switch reading loop seems OK bsf RP0 instead of bsf STATUS, 5 and explicitly use RP1 ie if you must use these as banking controls rp0 is status,5 rp1 is status,6 then to change to bank1 bsf status,rp0 bcf status,rp1 ;comments added !!!!!! bsf status,5 ;bank 1 (hopefully) movlw b'11111111' ;PortA as all inputs movwf TRISA ;;;;;; Note that unused PortA pins are floating ;;;;;;;;; If you want just one PortA pin as an input then use movlw 00000010 to set PortA as i/p and the others as outputs ================================================= You ___MUST___ also set CMCON to get PortA pins as digital movlw 0x07 movwf cmcon ================================================= movlw b'00000000' ;PortB as all outputs movwf TRISB movlw b'00000100' ;pre-scaler assigned to Watchdog ???? movwf OPTION_R clrf PCON ;select 37kHz osc (if CONFIG is set properly ???????) bcf STATUS, 5 ;back to bank0 (hopefully) clrf PORTA clrf PORTB ; program starts now BEGIN btfsc PORTA, 1 ;wait for a.1 to ground goto BEGIN movlw b'11111111' ;set all b outputs high = light LEDs movwf PORTB KEEPON btfss PORTA, 1 ;wait for a.1 to return high goto KEEPON clrf PORTB ;set all b outputs low = LEDs off goto BEGIN ;loop END -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu