> When you read the port the second instruction, the PIC >reads the state of the port in hardware, the capacitively loaded pin is >still changing state, then the pic WRITES what it reads to the port. Thus you can tell a pin to go to zero, immediately read it, it is read as zero, then come back later and it is 1 and you say "What the F()&%#$&*&#$???" BTDT, it sucked. This is a foible the AVR is blissfully immune to. The AVR has DDR (Data Direction register) PORT (output) and PIN (input) registers, so I can do anything I like on the PORT, to set outputs, and the PIN reads me what they are actually doing. If I set a port pin high, which is shorted to ground (or has a large capacitance) then the PIN bit will read 0 but PORT will remain a 1. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body