- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
05-02-2017 06:49 AM
I use a Happy Gecko MCU and I want to charge a battery pack via USB with 500mA.
Now I ran into a probleme I only want to charge with 500mA if the host device is able to do this.
I configure the bMax parameter and make USBD_init(); and then wait if the State of the USB change to ADDRESSED then I start charging with 500mA. WIth a normal PC with USB 2.0 this works fine.
The Problem is if I want to charge the battery pack with a power supply connected to a socket the USB status never is ADDRESSED so it only loads with 100mA even if the power supply is able to load with 500 mA.
Is it possible to recognize the power supplys and check if they are able to charge with 500mA???
Every answer is verry welcome
Solved! Go to Solution.
05-02-2017 12:24 PM
You'll need to refer to the USB Battery Charging Specification (latest revision is 1.2; Google is your friend) to see how to handle this. Maxim has a nice summary here.
When you are plugged into a charger, there is no host communication, so you cannot rely upon any kind of USB status change to make decisions.
Essentially, you need to detect various levels on D+ and D- to determine when there is a charger at the other end of the cable and what kind of current draw it can support. The USB transceiver on Happy Gecko does not have this capability, so you will need external circuit to perform the detection for you. I did some quick checking, and it doesn't look like anyone sells a circuit specifically to do this, so the external components must not be too much of a hassle to do the job.
05-11-2017 07:23 AM
Add-on chips to detect charger (BC1.2) on USB device side:
TI BQ24392 - Dual SPST USB2.0 High Speed Switch with USB Battery Charging Specification Revision 1.2 Detection
Microchip (SMSC) USB375x - USB 2.0 Port Protection with Integrated Switch and Charger Detection - BC1.2
Fairchild FSA832 - USB2.0 High-Speed (480Mbps) Charger Detection with Isolation Switch - BC1.2