David Novak wrote: > I am using a PIC16C765 for USB communications. Is it possible, within the > PIC code, to sense when the USB cable has been disconnected? Hi, I used to do this: banksel USWSTAT movlw 0x03 andwf USWSTAT,w ; compare lower 2 bits of USWSTAT xorlw CONFIG_STATE ; with configured state bz usbIsConfigured ; are we configured? USWSTAT should change (IIRC) if cable is disconnected. -- Ciao, Dario -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist