EmbeddedRelated.com
Forums

USB Battery Charging without Microprocessors

Started by Tim Wescott February 29, 2016
First: Sorry to those c.a.e folks who abhor s.e.d -- hopefully the 
politics won't bleed onto this thread.

On to the real question.  It's phrased oddly, but I think it gets to the 
point best:

If I have a dingus with a battery in it, and I want to charge that 
battery via USB, and I want to get the most out of the USB port, does 
that dingus have to have a microprocessor in it that talks on the USB?

OR, can I determine how much current I can draw via USB with some purely 
analog arrangement of circuitry on the "battery charge" side.

I think I know the answer, but I'd like to be surprised.

-- 

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
On Mon, 29 Feb 2016 13:51:40 -0600, Tim Wescott wrote:

> First: Sorry to those c.a.e folks who abhor s.e.d -- hopefully the > politics won't bleed onto this thread. > > On to the real question. It's phrased oddly, but I think it gets to the > point best: > > If I have a dingus with a battery in it, and I want to charge that > battery via USB, and I want to get the most out of the USB port, does > that dingus have to have a microprocessor in it that talks on the USB? > > OR, can I determine how much current I can draw via USB with some purely > analog arrangement of circuitry on the "battery charge" side. > > I think I know the answer, but I'd like to be surprised.
Whoops, answered my own question (and the answer is yes, I can do it all analogly). http://www.usb.org/developers/docs/devclass_docs/BCv1.2_070312.zip -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Tim Wescott wrote:
> First: Sorry to those c.a.e folks who abhor s.e.d -- hopefully the > politics won't bleed onto this thread. > > On to the real question. It's phrased oddly, but I think it gets to the > point best: > > If I have a dingus with a battery in it, and I want to charge that > battery via USB, and I want to get the most out of the USB port, does > that dingus have to have a microprocessor in it that talks on the USB? >
Yes. They have to negotiate power levels. "Hi, I'm a USB device and I need 500 mA". "Sorry, I only have 100mA."
> OR, can I determine how much current I can draw via USB with some purely > analog arrangement of circuitry on the "battery charge" side. > > I think I know the answer, but I'd like to be surprised. >
There's always a way. Whether it's a *good* way depends. -- Les Cargill
On Mon, 29 Feb 2016 17:34:41 -0600, Les Cargill
<lcargill99@comcast.com> wrote:

>Tim Wescott wrote: >> First: Sorry to those c.a.e folks who abhor s.e.d -- hopefully the >> politics won't bleed onto this thread. >> >> On to the real question. It's phrased oddly, but I think it gets to the >> point best: >> >> If I have a dingus with a battery in it, and I want to charge that >> battery via USB, and I want to get the most out of the USB port, does >> that dingus have to have a microprocessor in it that talks on the USB? >> > >Yes. They have to negotiate power levels. > >"Hi, I'm a USB device and I need 500 mA". > >"Sorry, I only have 100mA." > >> OR, can I determine how much current I can draw via USB with some purely >> analog arrangement of circuitry on the "battery charge" side. >> >> I think I know the answer, but I'd like to be surprised. >> > >There's always a way. Whether it's a *good* way depends.
I have a old Core-2-Duo Mini ITX MB here that will Halt and show an error in text on the screen if too much current in drawn from the USB bus. It's a pretty nasty handling of an over current condition. Cheers
On Mon, 29 Feb 2016 23:14:54 -0500, Martin Riddle wrote:

> On Mon, 29 Feb 2016 17:34:41 -0600, Les Cargill <lcargill99@comcast.com> > wrote: > >>Tim Wescott wrote: >>> First: Sorry to those c.a.e folks who abhor s.e.d -- hopefully the >>> politics won't bleed onto this thread. >>> >>> On to the real question. It's phrased oddly, but I think it gets to >>> the point best: >>> >>> If I have a dingus with a battery in it, and I want to charge that >>> battery via USB, and I want to get the most out of the USB port, does >>> that dingus have to have a microprocessor in it that talks on the USB? >>> >>> >>Yes. They have to negotiate power levels. >> >>"Hi, I'm a USB device and I need 500 mA". >> >>"Sorry, I only have 100mA." >> >>> OR, can I determine how much current I can draw via USB with some >>> purely analog arrangement of circuitry on the "battery charge" side. >>> >>> I think I know the answer, but I'd like to be surprised. >>> >>> >>There's always a way. Whether it's a *good* way depends. > > I have a old Core-2-Duo Mini ITX MB here that will Halt and show an > error in text on the screen if too much current in drawn from the USB > bus. It's a pretty nasty handling of an over current condition. > > Cheers
On the plus side, the thing probably cost a whole dime less than it would have if the mobo were protected from excess USB current draw. -- www.wescottdesign.com
On Mon, 29 Feb 2016 17:34:41 -0600, Les Cargill
<lcargill99@comcast.com> wrote:

>Tim Wescott wrote: >> First: Sorry to those c.a.e folks who abhor s.e.d -- hopefully the >> politics won't bleed onto this thread. >> >> On to the real question. It's phrased oddly, but I think it gets to the >> point best: >> >> If I have a dingus with a battery in it, and I want to charge that >> battery via USB, and I want to get the most out of the USB port, does >> that dingus have to have a microprocessor in it that talks on the USB? >> > >Yes. They have to negotiate power levels. > >"Hi, I'm a USB device and I need 500 mA". > >"Sorry, I only have 100mA." > >> OR, can I determine how much current I can draw via USB with some purely >> analog arrangement of circuitry on the "battery charge" side. >> >> I think I know the answer, but I'd like to be surprised. >> > >There's always a way. Whether it's a *good* way depends.
It's not clear to me if Tim wants to run off a "real" USB port, off a USB- charger type of device, or both. In the case of a "real" USB port, it'll certainly have to be negotiated. OTOH, that doesn't work at all for most USB chargers, which don't have nearly the brains needed to support that. There are several schemes in use, all doing odd things to the D+ and/or D- lines (sinking one or the other to Vs or ground via a resistor, that sort of thing) to indicate that they support more than the standard minimum (100ma). So determining the maximum available power on the port requires checking for the (several) schemes fiddling with D+/D-, failing that negotiating with a "real" USB host, and failing that assuming 100ma. Fortunately there are chips that will do at least a partial job of that, but I don't know of one that supports all of the schemes in use (Sony, Apply, DCP, a couple of schemes used in China, several other custom schemes that exist mainly to sell "special" chargers at exorbitant prices) simultaneously.
Robert Wessel wrote:
> On Mon, 29 Feb 2016 17:34:41 -0600, Les Cargill > <lcargill99@comcast.com> wrote: > >> Tim Wescott wrote: >>> First: Sorry to those c.a.e folks who abhor s.e.d -- hopefully the >>> politics won't bleed onto this thread. >>> >>> On to the real question. It's phrased oddly, but I think it gets to the >>> point best: >>> >>> If I have a dingus with a battery in it, and I want to charge that >>> battery via USB, and I want to get the most out of the USB port, does >>> that dingus have to have a microprocessor in it that talks on the USB? >>> >> >> Yes. They have to negotiate power levels. >> >> "Hi, I'm a USB device and I need 500 mA". >> >> "Sorry, I only have 100mA." >> >>> OR, can I determine how much current I can draw via USB with some purely >>> analog arrangement of circuitry on the "battery charge" side. >>> >>> I think I know the answer, but I'd like to be surprised. >>> >> >> There's always a way. Whether it's a *good* way depends. > > > It's not clear to me if Tim wants to run off a "real" USB port, off a > USB- charger type of device, or both. > > In the case of a "real" USB port, it'll certainly have to be > negotiated. >
And if it's not, there's no general statement to be made, SFAIK. You've constrained the state space nicely.
> OTOH, that doesn't work at all for most USB chargers, which don't have > nearly the brains needed to support that. There are several schemes > in use, all doing odd things to the D+ and/or D- lines (sinking one or > the other to Vs or ground via a resistor, that sort of thing) to > indicate that they support more than the standard minimum (100ma). > > So determining the maximum available power on the port requires > checking for the (several) schemes fiddling with D+/D-, failing that > negotiating with a "real" USB host, and failing that assuming 100ma. > > Fortunately there are chips that will do at least a partial job of > that, but I don't know of one that supports all of the schemes in use > (Sony, Apply, DCP, a couple of schemes used in China, several other > custom schemes that exist mainly to sell "special" chargers at > exorbitant prices) simultaneously. >
-- Les Cargill