Disconnecting and reconnecting using DISCON bit in USBCS register of FX1/FX2/FX2LP

Question: Can a Bus Powered device be disconnected and reconnected using DISCON bit in USBCS register?

 

Answer:

Yes, a Bus Powered device can be disconnected and reconnected using the DISCON bit in the USBCS register. Setting this bit will disconnect the device and the device loses control over D+ and D- lines but as VBUS and Gnd lines are still connected, code will keep on executing. As soon as we reset the DISCON bit in the USBFS register our device will re-enumerate again.