[Desire Android Development] theGanymedes:
How to make battery "think" it's full easier

Please note that this process does actually let your battery think it's charged to full before it's topped-up, so you might lose, say, up to 10 minutes of battery power after doing this process.

How to make your battery think it's full in shorter amount of time?

What's the theory?

Well, while calibrating our batteries, we write 0x06 to the 65th register area - this area is what's keeping the IMIN (minimum charge current) value, which is used by the DS2784 chip in order to sense the "charge full" event.

Since there is no "absolute" way to find out when the charge is full in Li-ion batteries, the chip makes a very nice way to overcome this difficulty: since it continuously checks the current level of battery; it makes an assumption such that the

battery will be full when the current level is positive and is below of IMIN value for the last two readings

(remember we saying that the current should not be ever negative when learning occurs? This is why - if current becomes negative, battery doesn't raise "battery is full" event and learning becomes half-baked!)

Before the calibration starts, we set the address 65 to 06 - which corresponds to 20.1 mA; so when the battery current level drops below 20mA and is positive for the last two readings; the battery is respected as to be full.

When the "battery full" even is raised, the DS2784 chip automatically increases the percentage to 100% and ACR (current capacity) level to "full40 * age" value - so basicly it resets the counters to "full" state.

However, 20mA is really a low value - we actually completely fill our cells with this value. Due to this, it takes longer time to hit 100%, because "real" full capacity can only be hit during saturated-charge cycles - which requires quite long time.

If you think that it's annoying to wait till your batteries so full that it can't even keep another electron in it ( :) ), you can of course make it "less sensitive" so that the battery will think it's full earlier. Normally, in stock devices, this already applied; but we've overwritten that in calibration.

To exemplify this case, consider those values: in stock case HTC marks the battery full when current is below 80 mA, whilst we wait till 20mA - this is actually one of the reasons why your battery stays for longer time after it's calibrated - It's simply because we really make it full :)

You may say that "we overcharge our batteries and this is bad!" but, that's not the case: the batteries are overcharge protected with DS2784. We simply charge it "higher".

What should we do if we want it to be less sensitive again?

Well, it's simple. First wait till your battery drops below 90%, so "Charged to Full" flag is cleared. After this, apply those steps; and it'll be done:

--NOTE: The IMIN value in register 65 is kept in 50 microVolt values. In order to convert this to current(mA) value, we must multiply(divide) this value with 50 * 67 and then divide(multiply) with 1000 while reading (writing to) this value from the register.

Example

: My battery chip has 06 (hex) value in register 65.

06(hex) = 6 decimal

6 * 50 * 67 / 1000 = 20.1 mA <--- so my battery currently thinks it's full when current is positive and below 20 mA

----

Let's say, I want it to be 50mA So:

50 * 1000 / ( 50 * 67) = 14.925 ~= 15 <-- (we can only use integers so we round)

15 (dec) -> F (hex) <- so I should write F to register 65.

--> Note: after writing 15 to register 65; you actually make IMIN value 50.2 ;)

----

What if I want to make it 35mAh - which is a better value I think?

35 * 1000 / (50 * 67) = 10.44 ~= 10 (or 11 if you prefer)

10 (dec) -> A (hex)

11 (dec) -> B (hex)

so I write A (or B) to register 65. This makes my battery raise "battery full" when current level drops below 33.50 mA (or 36.85 mA).

---

NOTE: You can read the register's value with the Battery Calibrator App, using "Dump registers" function - you have to find the 65'th register in that dump (6th from the left on the "60 - " line)