Content originally posted in LPCWare by jdupre on Mon Jul 15 14:02:58 MST 2013
I don't understand the use of USB_PWRD. The 17xx/18xx User manual says:
Quote:
USB_PWRD2 — Power Status for USB port 2. When using the chip in USB host mode, the USB_PWRD input must be enabled. The USB host controller will only detect a device connect event when the port power bit is set in the OHCI and the USB_PWRD bit is asserted for the corresponding port.
I have the Embedded Artists LPC1788 development board. USB2 is configured for use as a host. In this case, J17 typically connects P1.30 to VCC on the host port (which is turned on and off via USB_PPWR2).
I also have USB OHCI code. In this code, P1.30 is configured as USB_VBUS, not USB_PWRD2. The thing that puzzles me is that the USB host code detects a device being plugged in and/or removed EVEN IF P1.30 IS NOT CONNECTED. (That is, I have removed the J17 jumper so P1.30/USB_PWRD2/USB_VBUS is now floating).
So, what exactly is USB_PWRD for? USB Host functionality seems to work whether it's connected or not.