me: >pin tristated off downside of this is having the pin tristated if it is not pulled low -> possible source of noise into the chip. might be a good opportunity to make use of the usually irritating lack of a shadow register for the port states: ; pin0 of port D is either connected to ground, vcc, or open circuit ; if o/c or vcc pin0 is driven high, if connected to ground pin0 is driven low bsf PORTD, 0 ; try and pull the pin high clrw ; (and wait a bit to let the voltage rise) xorwf PORTD, F ; read state of port D and drive it that way ; if pin0 was pulled low it will now be driven low ; if pin0 was floating or high it will now be driven high then again, no obvious advantages to that over: ; pin0 of port D is either connected to ground or open circuit ; if o/c C will be set, if connected to ground C will be cleared bsf PORTD, 0 ; try and pull the pin high nop ; wait a bit to let the voltage rise rrf PORTD, W ; state of pin0 port D into Carry bcf PORTD, 0 ; pull the pin low oh well... probably just pointless rambling, but the use of 'clrw/ xorwf portX, F' does feel like it _should_ be really useful. Regards, Simon -- 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