PIC16C765 detect USB cable detached

Jun 30, 2007 1 Replies

Is there a way for the software inside the PIC to detect when the USB cable has been detached from a PIC16C765?



We haven't been able to find a register bit that indicates when the cable is not attached.



Thanks, David


You could use the USB CONTROL REGISTER (UCTRL: 195h) bit 5: SE0: Live Single Ended Zero This status bit indicates that the D+ and D- lines are both pulled to low.

1 = Single ended zero being received 0 = Single ended zero not being received

You could also detect an idle state with USB INTERRUPT FLAGS REGISTER (UIR: 190h) bit 4: UIDLE: This bit is set if the USB has detected a constant idle on the USB bus signals for 3 ms. The idle timer is reset by activity on the USB bus. Once a IDLE condition has been detected, the user may wish to place the USB module in SUSPEND by setting the SUSPEND bit in the UCTRL register.

-- Joe

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required