> I am using a 16F716 with all portb pins tied to ground through 20k > resistors. I have also tied portb(4..7) to Vcc through switches and 1k > resistors. I use portb(4..7) to address a mux and portb(0..3) to drive > relays through a buffer. Please make the circuit a little bit more clear. Where are the resistors? Which MUX? > Here is what I have tried so far (sorry for the parallax): And you should be. Unfortunately I can't help with the code, as I am not entirely sure what the instructions do exactly. If they do what I think they do, it should work fine, however, they might do something else. MPLAB compatible code is a wiser choice. > I am wondering how to do this and whether it is possible without affecting > the outputs driving the relays on portb(0..3). Given that the 16F716 has an 8-bit analog to digital converter, I would recommend hooking all the switches up to that: you're using resistors anyway. Give each switch a different resistor value, use the AD converter to sample the result and there you have your switch status, using only 1 port. Greetings, Maarten Hofman. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist