I'm using pic18f and have a usb code in it and it recognizes the device each time the PIC KIT is powered and does not recognize as the PICKIT3 is removed.I have cross-checked all the h/w pins vdd vss vusb and proper grounds and all are fine.But have this strange error.The Pickit3 powers via Usb and I'm using a Usb-B cable to do detection.Even if don't power pickit3 via s/w it still detects the usb device as i have powered from extra source, but once i remove the physical connection the Device is not recognized.

Is this a h/w problem.IF so the Pickit3 connects just vdd,vss,pgd,pgc and MCLR and voltages on all are fine. The thing is I have driven an LED in the same code and it still lights up and disconnects the device when the PICKIT3 is removed.

I would appreciate any valuable insights folks.


closed as unclear what you're asking by Dave Tweed, Matt Young, Chetan Bhargava, Joe Hass, Daniel Grillo Feb 14 '14 at 15:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ I cannot figure out what your setup is from the description. Can you provide a diagram of some sort? \$\endgroup\$ – Dave Tweed Feb 14 '14 at 14:01

I too found it difficult to understand.

The reason the device is not recognized when you remove external power is that the conditions for bus powered USB are not being met. The cause of this can be plenty.

Here is what the USB spec says: Powered USB devices may obtain power from an external source and/or from the USB through the hub to which they are attached. Externally powered USB devices are termed self-powered. Although self-powered devices may already be powered before they are attached to the USB, they are not considered to be in the Powered state until they are attached to the USB and VBUS is applied to the device. A device may support both self-powered and bus-powered configurations. Some device configurations support either power source. Other device configurations may be available only if the device is selfpowered. Devices report their power source capability through the configuration descriptor. The current power source is reported as part of a device’s status. Devices may change their power source at any time, e.g., from self- to bus-powered. If a configuration is capable of supporting both power modes, the power maximum reported for that configuration is the maximum the device will draw from VBUS in either mode. The device must observe this maximum, regardless of its mode. If a configuration supports only one power mode and the power source of the device changes, the device will lose its current configuration and address and return to the Powered state. If a device is self-powered and its current configuration requires more than 100 mA, then if the device switches to being bus-powered, it must return to the Address state. Self-powered hubs that use VBUS to power the Hub Controller are allowed to remain in the Configured state if local power is lost. Refer to Section 11.13 for details.

Most likely the problem is with the hardware configuration on your PIC.

I suggest you look for disrepencies of your pic hardware with suggested USB schematic. Focusing on VBUS will help.


Not the answer you're looking for? Browse other questions tagged or ask your own question.