Yes I did.
But let's pretend I didn't.
You can put the PIC to sleep, and it will re-enumerate when re-connected.
The main oscillator is stopped in sleep mode, so the USB module's clock also stops.
You can also place the USB module in SUSPEND mode to reduce the current from the USB module. That's done in response to an IDLEIF, currently used to determine un-plugged state in DT_HID.
When the USB cable is plugged in, you'll get ACTVIF interrupts (a signal to RESUME from SUSPEND mode).
So you don't even need to connect USB +5V to an INT pin.
The USB module can detect the changes.
It's just that you have to do it. Nothings automatic.
Bookmarks