Charging Neo Freerunner via USB port
roh at openmoko.org
Sat Apr 19 01:47:27 CEST 2008
Michael Shiloh wrote:
> Flemming Richter Mikkelsen wrote:
>> - Ohh, and a valid charger ID would be a resistance between res_min
>> and res_max.
>> - Several pins could be probed
> You can only probe the pins that have the appropriate hardware interface
> to them. This may be all, but can't be taken for granted. One of the
> hardware people can tell us which pins are capable of this, and how you
> select which one you want to measure.
there is only one pin to measure.
the 'id pin' is pin number 4 directly beneath pin 5 which is gnd.
pin 1 is vcc (5V)
2 and 3 are D- and D+ for usb data.
thus all pins are 'taken' by standard besides the 'id pin'
on gta02 its connected to an adc inside the pmu.
the id pin is connected directly to pin9 of the pmu (adcin1)
in addition to that there is one resistor of 100k(1%) to gnd and one of
39k(1%) to pin8 of the pmu (accsw)
now everyone should be able to do the math while looking at the pmu
motorola chargers have a 200k (pretty exact, shows 200.0 on my
not-that-cheap-but-chinese multimeter) resistor to gnd.
in addition to that they short D+ and D- to each others (read about that
too in some usb-charging-spec), but i think we can ignore that because
detecting that would propably quite some hacking if possible at all
(dunno the usb-hw-if of the samsung enough) and also not that helpful.
i wouldn want to have a 'range' of 'recognized valid resistance' but
rather a table..
* 48k -> moko charger (2A) -> 1A mode
* 200k -> motorola charger (550mA) -> 500mA mode
if no resistor or short is detected -> if it speaks usb and does
enumerate us as 500mA -> 550mA mode
if it does not speak usb at all or only enumerates us as 100mA -> 100mA mode
the nice thing is: this whole feature doesn't affect the hw going to mp.
its a software needs to have more (to be found out) values and fitting
modes coded in.
the code to measure the pin should be in uboot and kerneldrivers. didn't
have a look at both yet.
but yes. a nice small (can be console) way to find out the adc value
would be practical to build the table of known to be valid chargers.
More information about the community