Content originally posted in LPCWare by SimonThome on Tue Oct 14 00:38:34 MST 2014
It turns out my USB Host stack was disabling the USB_DEV_CLK_EN flag in the USB OTG clock control register, when it was being initialized after the USB Device stack was initialized. This disabled the detection of the presence of the USB bus voltage on the VBUS pin.
The application note "AN11392 - Guidelines for full-speed USB on NXP's LPC microcontrollers" should update the section on ESD diodes and the voltage divider to the VBUS pin.
Consider the following scenario of a self powered USB device:
When the 1K5 pull-up resistor on D+ is enabled, followed by the USB host being disconnected, this will still forward bias the ESD diode between D+ and VBUS. With the suggested resistor divider values of 24K and 39K this will still cause a logic high to be registered by VBUS, thus the USB controller and stack will not register that the host has actually disconnected from the device.
Can someone at NXP please provide some feedback on this? - Thanks.