Read Modify Write "bug" is not a bug, it's just the PIC doing what it's supposed to do. Reading a port actually reads the pins. If you've just written to the output port (actually the output latch), the pins may not have changed. They could be heavily loaded (perhaps shorted to ground and will never change), or have a capacitive load so it takes time for the voltage on the pin to change. This read/modify/write problem can be avoided in several ways. One is to insert a delay between the write and the next read. Another is to keep a "port mirror" in RAM. Modify the RAM location as you wish, then copy the result to the port. This avoids reading the port itself before the pins have had a chance to change. Finally, the PIC18 series has separate addresses for PORTx and LATx. You can do read-modify-write instructions on the output latch without worrying about how slowly the pin reacts. Harold ________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/web/. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body