Author Topic: Self-Powered to Bus-Powered (300 mA) and back - Section 9.1.1.2 Question  (Read 19879 times)

RobV

  • Member
  • ***
  • Posts: 3
I am reviewing the second paragraph of 9.1.1.2 of the USB 2.0 Specification (rev 2) and have a question regarding transitions between self-powered and bus-powered.

It is not very clear on the behavior when switching between the two power options.

1) Do I need to re-enumerate (disconnect, but detaching the pull-up resistor) the function from the host?

2) I notice there is mention of GetStatus and reporting the bus power state. However, with a USB analyzer, I never see this message except during enumeration.

3) If bus powered and then I connect my self-power, do I need to re-enumerate or can I just keep on going?

I would prefer to remain under the same enumeration if possible without violating the USB Specification. Any thoughts?

I'm using an MSP430 for the USB Function (device).

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
If the USB communications change when self powered (for example, if the device needs self power to perform its function), force a re-enumeration that returns a configuration descriptor with the current information.

Jan

RobV

  • Member
  • ***
  • Posts: 3
Does this also hold true if the device was bus powered and then external power is connected?

1) Enumerate as bus powered device
2) Connect external power (no longer fully powered by bus)
3) Re-enumerate by disconnecting from the bus.

Or can I skip step 3?

If the USB communications change when self powered (for example, if the device needs self power to perform its function), force a re-enumeration that returns a configuration descriptor with the current information.

Jan

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
What is your device? What can it do when self powered that it can't do when bus powered?

Jan

RobV

  • Member
  • ***
  • Posts: 3
Jan,

The device is driving a load over one unit load (between 160 mA and 300 mA). The device is to retain this state if external power is connected or active on the bus.

However, during suspend, the device would have to get below 2.5 mA to meet USB spec. To avoid the problem, this is where external power comes in.

I guess my questions relates to over-engineering and allowing "hot plugging" of the external power. So, either connect or disconnect external power.

The major case, is during normal operation. Not during suspend, as the device would indeed drop to less than 2.5mA as required when powered only by the bus.

I am currently developing the device and have control to make it behave in any manor, but would like to comply with USB 2.0

Thanks and Best Regards,
--Rob

mdlayt

  • Member
  • ***
  • Posts: 40
I think Jan's question is:  Why don't you just make your device completely self powered and have it "go away" when the supply isn't connected?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
If self-powered, the host or hub needs to provide only 100 ma. In practical terms, I think this would be important only when the device is connected to a low-power host (rare) or a bus-powered hub.In these cases, when self-powered, the device could enumerate; when bus-powered, the host or hub would refuse because it couldn't provide the requested current (> 100 mA).

So if you connect to a bus-powered hub, enumeration will fail. If you later attach the device's power supply, the host won't know about it and won't re-enumerate unless the device emulates detach/re-attach.

Jan