Sorry! I didn't think the ascii art would come out that bad!! It looked a lot better when I sent it. I'll try describing the circuit in words. Using 2 I/Os (RB0 and RB1 on a 16C505) I am trying to drive two back to back LEDs and read a switch at the end of 2 long wires . Each pin has a 470 ohm resistor in series with it and a .01 uF cap shunted to ground after the resistor. At the end of the two long wires there is a switch in series with a parallel combo. of a red and a green led (pointed in opposite directions) and a 10K resistor. There is also a 100k pullup at RB1. When I want to drive the back to back LEDs ( if the switch is closed) RB0 and RB1 are outputs . When I want to read the switch RB0 outputs 0 and RB1 tries to read whether the switch is closed ie. RB1 sees 1 if it is open , 0 if closed. The wire I am driving(reading) is quite long approx. 300 ft. I am having troubles reading the switch.I can read the switch ok if I don't change RB1 to an output . But thats no good because I have to be able to switch the LEDs.I tried putting nops between my TRIS statements etc. A code snippet is below If anyone has any suggestions I'd be grateful Check_Switch bcf PORTB,0 ; set input to switch 0 nop nop nop nop nop nop nop nop movlw b'00000010' TRIS PORTB ; change RB1 to input nop nop nop nop nop nop nop nop bcf FLAG,POWER_ON btfss PORTB,1 bsf FLAG,POWER_ON movlw b'00000000' TRIS PORTB ; put RB1 back to output nop nop nop nop nop nop nop nop return ------------------------------ End of PICLIST Digest - 6 Feb 2000 to 7 Feb 2000 (#2000-39) ***********************************************************