N900 Hardware Charge Meter

(Software: removed old obsolete info ~~Joerg)
 
(11 intermediate revisions not shown)
Line 1: Line 1:
-
There is a largely unused charge meter chip in the n900, a [http://focus.ti.com/docs/prod/folders/print/bq27200.html TI BQ27200].
+
There is a charge meter chip in the [[Nokia N900|N900]], a [http://focus.ti.com/docs/prod/folders/print/bq27200.html TI BQ27200] this can be used to accurately measure the state of the battery.
-
=Hardware=
+
 +
==Hardware==
In many phones, this chip would be integrated into the battery, which has a number of benefits, from more rapid temperature sensing of potentially dangerous conditions in the battery, to being able to swap the battery, and have the swapped batteries charge accurately measured instantly.
In many phones, this chip would be integrated into the battery, which has a number of benefits, from more rapid temperature sensing of potentially dangerous conditions in the battery, to being able to swap the battery, and have the swapped batteries charge accurately measured instantly.
-
The n900 integrates this chip onto the motherboard.
+
The N900 integrates this chip onto the motherboard.
 +
 
 +
==Software==
-
=Software=
 
It does not function properly in normal use with the stock [[N900 Software BME|BME]] as that usually turns off the phone before the threshold which would enable the charge monitor to properly learn the battery capacity.
It does not function properly in normal use with the stock [[N900 Software BME|BME]] as that usually turns off the phone before the threshold which would enable the charge monitor to properly learn the battery capacity.
Line 14: Line 15:
It also can be used for energy profiling - see [[N900_Hardware_Power_Consumption|this page on power use]].
It also can be used for energy profiling - see [[N900_Hardware_Power_Consumption|this page on power use]].
-
It is unclear if this chip is used at all by software in the phone by default.
 
-
There is no kernel driver in the default N900 software for this chip, a [http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/drivers/power/bq27x00_battery.c partial third party driver exists].
+
There is no kernel driver in the default N900 software for this chip, a [http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/drivers/power/bq27x00_battery.c partial third party driver bq27x00_battery exists].
 +
 
 +
This third party driver has some issues - for example - the 'current_now' value it exports is not mA, but needs multiplied by (3.57/n) - where n is the sense resistor in the N900. The sense resistor seems to be between 20 and 22 mR - but no accurate measurements have been performed, and the schematic does not help with this.
-
This third party driver has some issues - for example - the 'current_now' value it exports is not mA, but needs multiplied by (3.57/n) - where n is the sense resistor in the n900.
+
Now on kernel mailinglist is series of patches which improve (report more properties about battery then BME) kernel driver bq27x00_battery. All these issues are fixed. Backported patches for N900 are here: http://talk.maemo.org/showpost.php?p=925980&postcount=674
-
The sense resistor seems to be between 20 and 22mR - but no accurate measurements have been performed, and the schematic does not help with this.
 
 +
There's a [[N900_Hardware_Charge_Meter/bq-script|script]] and acompanying I2Ctools to read out the complete info from bq27200: http://enivax.net/jk/n900/bq.tar (thanks ShadowJK)
 +
Or you can use Joerg_rw's original bq27k-detail2 script.
 +
New version available at http://people.openmoko.org/joerg/battery/bq27k-detail2 works (with bash and i2c-tools installed) without any cmdline acrobatics, on OM FR and stock N900 (no broken bq27200.ko kernel module and thus no power kernel needed. Might even fail on some powerkernel versions when that module got loaded)
[[Category:N900 Hardware]]
[[Category:N900 Hardware]]

Latest revision as of 12:24, 16 October 2017

There is a charge meter chip in the N900, a TI BQ27200 this can be used to accurately measure the state of the battery.

[edit] Hardware

In many phones, this chip would be integrated into the battery, which has a number of benefits, from more rapid temperature sensing of potentially dangerous conditions in the battery, to being able to swap the battery, and have the swapped batteries charge accurately measured instantly.

The N900 integrates this chip onto the motherboard.

[edit] Software

It does not function properly in normal use with the stock BME as that usually turns off the phone before the threshold which would enable the charge monitor to properly learn the battery capacity.

With a replacement BME, it can learn battery capacity, and be used for useful life predictions.

It also can be used for energy profiling - see this page on power use.


There is no kernel driver in the default N900 software for this chip, a partial third party driver bq27x00_battery exists.

This third party driver has some issues - for example - the 'current_now' value it exports is not mA, but needs multiplied by (3.57/n) - where n is the sense resistor in the N900. The sense resistor seems to be between 20 and 22 mR - but no accurate measurements have been performed, and the schematic does not help with this.

Now on kernel mailinglist is series of patches which improve (report more properties about battery then BME) kernel driver bq27x00_battery. All these issues are fixed. Backported patches for N900 are here: http://talk.maemo.org/showpost.php?p=925980&postcount=674


There's a script and acompanying I2Ctools to read out the complete info from bq27200: http://enivax.net/jk/n900/bq.tar (thanks ShadowJK) Or you can use Joerg_rw's original bq27k-detail2 script. New version available at http://people.openmoko.org/joerg/battery/bq27k-detail2 works (with bash and i2c-tools installed) without any cmdline acrobatics, on OM FR and stock N900 (no broken bq27200.ko kernel module and thus no power kernel needed. Might even fail on some powerkernel versions when that module got loaded)