Genome wrote: >> Keep sending data suppose 0x55,0x01 and wait for response. > > My problem with the keep sending data is that there is no way of telling > when the pic is suddenly disconnected in the middle of a communication.. > i.e. the pic will just think that there are errors and no way of telling > whether the error is due to cable disconnection or just transmission > errors... I would like something like plugAndplay capability... Not even with DTR or any other signal you will be able to tell whether the error is due to cable disconnection or transmission error (say a broken cable or a pin with bad contact). Usually there is a problem that you should solve anyway when you have a significant number of transmission errors (as in scrambled bits) in a wired short-range serial link. Even though you can, you probably shouldn't have to deal with additional status lines. Sending out a "start of transmission" marker and waiting a short time seems good enough to me, too. You also didn't say on what side you want to detect the presence of a connected device. If you want to know at the PC side whether there's something connected at the serial port, the PC's DTR output doesn't seem to be the one you need -- an input (CTS, DSR, CT) would probably be better suited. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist