Operation without battery (GTA02)

Andy Green andy at openmoko.com
Wed Jul 23 09:16:30 CEST 2008

Hash: SHA1

Somebody in the thread at some point said:
| Andy Green wrote:
|> Jeffrey, if you are interested about what the battery experiences, there
|> are a bunch of goodies from the Coulomb Counter in the battery
|> accessible down /sys/class/power_supply/bat, just cat them.  These tell
|> you the battery's view of what is going on directly.
|> # cat /sys/class/power_supply/bat/current_now
|> is particularly interesting, this is the flow of current out of (+ve) or
|> into (-ve) the battery in uA.  These values come fresh from the Coulomb
|> Counter each time, but that device itself updates its registers only
|> every few seconds.
| Is there a Wiki page or docs that explain what each register is and
the units it refers to?
| especially in the .../power_supply/bat/... area which seems to have
very pertinent information.

I think I will start one.  There's some real gold down the /sys mine if
you are interested in meddling.

| Do the values appearing in the /sys/classes/... files differ anyway
from what the hardware provides
| or is it tweaked by the kernel?

Some of the coulomb counter data is actually directly provided in very
funny units relative to a sense resistor outside the chip (20mR in our
case), the driver does the recommended computation and normalizes them
to uV and uA as required by power_supply APIs.  And temp in 0.25 Kelvin
steps --> Celcius in 0.1 steps.  But this is basically scaling up
operation and you see otherwise unmassaged data.

The datasheet is open


as is the driver of course


and you can see there are even more registers in there that don't map on
to power_supply stuff.

- -Andy
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org


More information about the community mailing list