I had my device programmed to detach for two or three seconds, then reattach, and all was well. I tried halving the delay and, boom goes the dynamite, either Windows crashes or it puts me (and the hub above) on the bad list (of ports that it doesn't pay attention to ever again). It looks like uninstalling the hub device gets me back to a working port--faster than a reboot.....but....
Hasn't someone put a number on how long a device must be detached?
So far I've searched the USB 2.0 spec, Microsoft, Microchip, and Cypress and the first page of Google. Below is about the best I've found so far. I especially enjoy the comment about "last ditch effort"--in the context of a reference design that relies on it.
(Note that in the LVR reference fwhid.zip it is buried in EZUSB_Discon--I think.)
Mike
; *********************************************************************
; USB Soft Detach
; Clears the DEV_ATT bit, electrically disconnecting the device to the bus.
; This removes the device from the bus, then reconnects so it can be
; re-enumerated by the host. This is envisioned as a last ditch effort
; by the software.
; *********************************************************************
SoftDetachUSB
global SoftDetachUSB
banksel UCTRL
bcf UCTRL,DEV_ATT ; clear attach bit
bcf STATUS, RP0 ; bank 2
clrf outer
clrf inner
incfsz inner,f
goto $-1
incfsz outer,f
goto $-3
pagesel InitUSB
call InitUSB ; reinitialize the USB peripheral
return