If I were doing a similar project, I would follow=20 the specs that Apple has created for their=20 devices. They use a pair of voltage dividers=20 from 5V to each data line. The device being=20 charged measures those voltages and is able to=20 determine how much charge current is available=20 based on those voltages. The device defaults to=20 a maximum current of less than 100mA if the voltages are not present. Each new generation of Apple device that requires=20 more current than the previous has different=20 voltages present on the data pins. This allows=20 newer devices to still use a smaller charger from=20 an older generation without overloading the charger. The advantage of using Apple's specs is that the=20 chargers are so ubiquitous. For example, I=20 regularly purchase Apple-branded 5V "ice-cube"=20 chargers from eBay for cheap. They truly do=20 deliver a solid 5V at currents up to 1A. dwayne At 12:49 AM 1/25/2013, Ruben J=F6nsson wrote: >I am doing some research around a portable=20 >device powered with a Li-ion single >cell 750-900mAh rechargable battery. At this stage I am planning for a 145= 00 >size battery with built in protection. The charger circuit will handle ove= r >voltage/charging protection but the cell itself will handle under voltage >protection and it is a size that will fit in a standard AA holder. The dev= ice >will be connected to a PC via USB and will=20 >normally also be charged through the >USB port. > >I am planning to handle charging like this: When=20 >the unit gets connected to the >PC via an USB-port it is also powered from here. At this point the charger= is >not yet operating and the ucontroller will politely ask the USB host for h= igh >current (500mA). If granted the charger will be set for 350-400mA. If not = I >will asume that there is only 100mA available=20 >and will charge at around 60-80mA >(a little depending on how much I will need for the rest of the circuit). > >Now, I am wondering how to handle charging if it=20 >is connected to a stand alone >charger with a USB cable. This will not be able=20 >to communicate with the micro. >Does the fact that it can not communicate tell me to start high current >charging? How is this normally handled in phones for example? Does these U= SB >chargers tell the capabilities to the portable device in another way, e.g. >pullup/pulldown resistors on the D+/D- lines? > > >/Ruben > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >Ruben J=F6nsson >AB Liros Electronic >Box 9124 >200 39 Malm=F6 Sweden >www.liros.se >Tel +46 40142078 >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >-- >http://www.piclist.com PIC/SX FAQ & list archive >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist --=20 Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax www.trinity-electronics.com Custom Electronics Design and Manufacturing --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .