0
\$\begingroup\$

On a bare-metal project I have in mind, I would like to know if I can avoid to implement the multiple USB specs (O/E/xHCI) and still benefit from usb charging my battery. It will run on a almost broken/useless flashed smartphone with one mini usb port.

I literally don't want any usb port for media storage or hid or anything for that project. There will only be one app running.

I was thinking that the already existing hardware usb controller(s) would allow me that, but.. on the other hand, if it is not activated by software, it may be an issue.

Question:

Can I power up my batteries via a usb cable, without software usb implementation? Is there a shortcut avoiding the full usb implementation?

Thanks

Update, to make things clear:

My goal was to use one of my cables, without modification made on it, plug it into my phone, and let it charge. With that information, would you consider that it is still a "yes" to that question?

\$\endgroup\$
  • \$\begingroup\$ You can generally just connect the +5v and gnd wires and get 5v power - how much depends on the specific port, but 100mA is a safe value - most would work up to 500mA without any handshake, but beyond that will probably need some sort of protocol implementation - this answer may help as it explains it further \$\endgroup\$ – user2813274 Feb 2 '16 at 22:18
  • \$\begingroup\$ Could do with a diagram because this is unclear - I'm not sure if you're talking about charging the phone, or trying to charge something from the phone. By "device" in the last paragraph do you mean "phone"? \$\endgroup\$ – pjc50 Feb 3 '16 at 12:43
  • \$\begingroup\$ @pjc50: corrected. It is the same phone, no other devices are involved here. \$\endgroup\$ – Larry Feb 3 '16 at 13:24
  • 1
    \$\begingroup\$ Right. In that case, the phone will almost certainly charge as normal without any software support on the phone: this is what it does when you've run the battery completely flat and it has to charge while "off". \$\endgroup\$ – pjc50 Feb 3 '16 at 13:28
  • 1
    \$\begingroup\$ @pjc50 - not necessarily. For a a lot of phones and similar devices, what looks like power-off charging requires them to actually boot their kernel (or at mininum last stage bootloader), configure the PMIC, and then go to sleep. Depending on how deeply the poster is replacing the system, this functionality may not be present. Though if they are starting from working sources for a full system, it should be provided they don't cut too deeply in their paring down efforts. \$\endgroup\$ – Chris Stratton Feb 3 '16 at 14:22
3
\$\begingroup\$

Answer: Yes.

Maxim Integrated Guide to smart battery devices. Or if you're a "dumb device" kinda person, the device being charged can tie their data lines (D+ and D-) and receive maximum power from an adapter. Vice Versa YOu can always charge a USB device 5V @ 500mA regardless of what is present on the data lines (tied up or down or floating or anything). Anything past that would require one of the chips similar to the link's that intelligently (and without programming, i.e. you just solder it in and it works) charges the device that follows USB charging spec.

On the off chance you're talking about using your phone to charge something (still not quite sure, but adding for completeness), that's called OTG and from what I know you'll only be able to provide around 8mA from your phone to the device.

Addendum: Apple doesn't follow USB Charging spec. Ask apple why that is.

\$\endgroup\$
  • \$\begingroup\$ @Dave So, it won't work "as is" with a classical mini usb cable? I updated my goal, to make it clear \$\endgroup\$ – Larry Feb 3 '16 at 7:32
0
\$\begingroup\$

Yes, if I understand your question correctly. Cut a cable or remove the d+ and D- pins. This data goes through the D- D+ pins. USB Pinout. Use a volt meter in ohms mode if your unsure which pins go to which wires. This may require soldering. I think I have seen USB cables that only have the power and ground on ebay before, but I can't remember what the name is.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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