yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] RogerPodacter:
Hey i just tested the pershoot driver, and i think i had successful results. got up to 1382 mAh just charging normal with phone on.

08/25/2010 11:02:36 [INFORMATION] batt: 99%, 4148 mV, 129 mA (91 avg), 35.2 C, 1352 mA
08/25/2010 11:03:26 [INFORMATION] batt: 99%, 4148 mV, 113 mA (138 avg), 35.2 C, 1353 mA
08/25/2010 11:04:16 [INFORMATION] batt: 99%, 4153 mV, 139 mA (108 avg), 35.2 C, 1355 mA
08/25/2010 11:05:06 [INFORMATION] batt: 99%, 4153 mV, 137 mA (140 avg), 35.2 C, 1358 mA
08/25/2010 11:05:56 [INFORMATION] batt: 100%, 4148 mV, 87 mA (62 avg), 35.2 C, 1358 mAh
08/25/2010 11:06:47 [INFORMATION] batt: 100%, 4148 mV, 121 mA (41 avg), 35.2 C, 1364 mA
08/25/2010 11:07:37 [INFORMATION] batt: 100%, 4148 mV, 135 mA (86 avg), 35.2 C, 1366 mA
08/25/2010 11:08:33 [INFORMATION] batt: 100%, 4148 mV, 132 mA (69 avg), 35.3 C, 1368 mA
08/25/2010 11:09:25 [INFORMATION] batt: 100%, 4148 mV, 116 mA (112 avg), 35.3 C, 1369 mA
08/25/2010 11:10:15 [INFORMATION] batt: 100%, 4153 mV, 103 mA (115 avg), 35.2 C, 1371 mA
08/25/2010 11:11:05 [INFORMATION] batt: 100%, 4153 mV, 117 mA (117 avg), 35.2 C, 1371 mA
08/25/2010 11:11:55 [INFORMATION] batt: 100%, 4153 mV, 99 mA (102 avg), 35.2 C, 1372 mAh
08/25/2010 11:12:46 [INFORMATION] batt: 100%, 4153 mV, 108 mA (88 avg), 35.2 C, 1374 mAh
08/25/2010 11:13:36 [INFORMATION] batt: 100%, 4153 mV, 88 mA (67 avg), 35.2 C, 1376 mAh
08/25/2010 11:14:26 [INFORMATION] batt: 100%, 4157 mV, 94 mA (94 avg), 35.1 C, 1377 mAh
08/25/2010 11:15:16 [INFORMATION] batt: 100%, 4157 mV, 106 mA (61 avg), 35.2 C, 1377 mA
08/25/2010 11:16:06 [INFORMATION] batt: 100%, 4157 mV, 97 mA (88 avg), 35.2 C, 1379 mAh
08/25/2010 11:16:57 [INFORMATION] batt: 100%, 4157 mV, 87 mA (79 avg), 35.2 C, 1380 mAh
08/25/2010 11:17:47 [INFORMATION] batt: 100%, 4157 mV, 86 mA (87 avg), 35.2 C, 1382 mAh
08/25/2010 11:18:37 [INFORMATION] batt: 100%, 4138 mV, 78 mA (85 avg), 35.2 C, 1382 mAh
08/25/2010 11:18:37 [INFORMATION] batt: charging BATTOFF [FULL]
08/25/2010 11:19:27 [INFORMATION] batt: 100%, 4143 mV, 0 mA (0 avg), 35.2 C, 1382 mAh
08/25/2010 11:20:17 [INFORMATION] batt: 100%, 4143 mV, 0 mA (0 avg), 35.1 C, 1382 mAh
08/25/2010 11:21:07 [INFORMATION] batt: 100%, 4143 mV, 0 mA (0 avg), 35.0 C, 1382 mAh

but like we said earlier, something else is telling FULL and to stop charging, since it didnt reach 20 mA. and voltage has gone much higher in the past, so it didnt hit the upper voltage limit either. at least with this method we have a better chance getting extra mAh with charging on.

hell or it could have been a fluke and one of those "lucky charges" i've gotten in the past. i've woken up for work, checked, and my phone is at 1408 mAh charging all night turned ON. its just a lucky charge somehow.
[Nexus One Android Development] RogerPodacter:
no problem. also the timestamp was off by 20 minutes last night, seemed to grow worse over time. but today its normal. just speculating.

i'm doing a full discharge today at work to kill it completely. my battery shuts off at 10% anyway, but i'll make the attempt. do you specifically want USB at the end, or AC?

clear stats? i'll export multiple dmesg logs along the way. not sure what stats to clear unless you refer to batterystats.bin which i dont think is anything related.
[Nexus One Android Development] pershoot:
the TIMEOUT your receiving is from my kernel or something you were using and testing against?
[Nexus One Android Development] RogerPodacter:
it was from the new kernel you posted yesterday. i was on stock cm rc3, then flashed the new kernel and tested last night. nothing else was i testing other than that..

EDIT: since i havent seen the timeout message today, perhaps last night was unique error since i had just flashed it earlier in the night. i'll keep look out for the timeout error again today and capture logs.
[Nexus One Android Development] pershoot:
k pls discharge 10->charge 100 wall, clear battery stats in recovery, then drain to 85%, and charge back up via usb to 100 and see if you spot them. then pls do the same for wall charge (drain to 85% and then wall) and snap a log.

thx.
[Nexus One Android Development] RogerPodacter:
OK, i will post the results for both logs.

on different topic, i've bump charged and am at 1414 mAh right now. disconneting from charger to start my discharge tests.

08/25/2010 11:50:17 [INFORMATION] batt: 100%, 4172 mV, -4 mA (52 avg), 30.8 C, 1414 mAh
08/25/2010 11:50:17 [INFORMATION] batt: charging OFF [FULL]
08/25/2010 11:50:21 [INFORMATION] batt: charging BATTOFF [FULL]
08/25/2010 11:51:25 [INFORMATION] batt: 100%, 4167 mV, 0 mA (0 avg), 30.7 C, 1412 mAh
08/25/2010 11:52:25 [INFORMATION] batt: 100%, 4167 mV, 0 mA (0 avg), 31.0 C, 1414 mAh
08/25/2010 11:53:15 [INFORMATION] batt: 100%, 4167 mV, 0 mA (0 avg), 31.1 C, 1414 mAh
08/25/2010 11:54:06 [INFORMATION] batt: 100%, 4162 mV, 0 mA (0 avg), 31.2 C, 1414 mAh

perfect way to start off?
[Nexus One Android Development] RogerPodacter:
Could i test a version of this driver where we remove the status_reg check completely, and instead just use the condition that if current_uA < 20 mA to disable the charger? its obviously safe as the current ramps down slower and slower, since that is how li-ion batteries work. there should not be any risk, and theoretically we could set current_uA == 0 since at some point the battery will be completely full and not accept any current at all. but ignore that part, i would try the 20 mA one.

Old Method:

if (di->status.status_reg & 0x80) {
448 di->status.battery_full = 1;
449 charge_mode = CHARGE_BATT_DISABLE;
450 } else
451 di->status.battery_full = 0;

New method:

if (di->status.current_uA <= 20000) {
448 di->status.battery_full = 1;
449 charge_mode = CHARGE_BATT_DISABLE;
450 } else
451 di->status.battery_full = 0;

would this be feasible? or is there something wrong with not checking the status reg bit. i'd like to test if possible just for fun. but not now, only after doing the current timeout testing.

EDIT: even better, once the current_uA < 20, THEN we could set the status reg afterwards? is this even make sense?
[Nexus One Android Development] pershoot:
already doing it with a uA check + percentage:

if ((di->status.status_reg & 0x80) &&

((di->status.current_uA/1000) <= 80) &&

(di->status.percentage == 100)) {

di->status.battery_full = 1;

charge_mode = CHARGE_BATT_DISABLE;

}
[Nexus One Android Development] theloginwithnoname:
can we drop that 80 to 20 (for Rog) or 2 (my pref) - prob best not to publicise the link on droidbasement though!
[Nexus One Android Development] RogerPodacter:
i understand. but i wanted to test with <= 20 which was what started all this in the first place. and also is it possible to NOT do the status reg check 0x80?

i feel like that is what could be stopping the charge process even though the cuurent_uA condition has not been met.

if (di->status.current_uA <= 20000) i would like to test this implementation.

and this whole time, have we been testing with 80 mA? if so now i;m really confused...
[Nexus One Android Development] RogerPodacter:
my theory is that the ONLY thing we need to check is the current. li-ion battery wont take more charge than it can hold, which we see the current_uA gets lower and lower as the batt gets full. so my theory is that we could set current_uA == 0 and technically it would work. but 20 mA is a good enough check as well. i want to try removing the status_reg check and replace with the current_uA <20 check!
[Nexus One Android Development] RogerPodacter:
to quote my earlier results, look at this log. it STILL cut off at 80 mA, but it was well on its way to hitting 1400 mAh until that current_uA<80 stopped it. if we could jsut lower the value to current_uA<20 then i think we might have some positive results!
[Nexus One Android Development] pershoot:
is this what you want?

if ((di->status.status_reg & 0x80) &&

((di->status.current_uA/1000) <= 20) &&

(di->status.percentage == 100)) {

di->status.battery_full = 1;

charge_mode = CHARGE_BATT_DISABLE;

}
[Nexus One Android Development] RogerPodacter:
yes exactly. and then to take that one step further, i wondered if its possible to test this:

if ((di->status.current_uA/1000) <= 20)
(di->status.percentage == 100)) {
di->status.battery_full = 1;
charge_mode = CHARGE_BATT_DISABLE;
}

where we remove the status_reg completely. but i will test option #1 first just to keep things simple.
[Nexus One Android Development] pershoot:
is 20 a safe margin? how about 40?

lets leave the status_reg check. it might correct a race condition somewhere (i have not thoroughly inspected the code along the track).
[Nexus One Android Development] RogerPodacter:
Yes I feel 20 is safe. Really it could be zero, but I want to be safe at first.

The next test I would like to remote status reg check, but I agree with you. That's why I wanted to test these myself first. Thanks a lot!
[Nexus One Android Development] RogerPodacter:
to understand what is happening, look at this dmesg log:

08/25/2010 11:02:36 [INFORMATION] batt: 99%, 4148 mV, 129 mA (91 avg), 35.2 C, 1352 mA
08/25/2010 11:03:26 [INFORMATION] batt: 99%, 4148 mV, 113 mA (138 avg), 35.2 C, 1353 mA
08/25/2010 11:04:16 [INFORMATION] batt: 99%, 4153 mV, 139 mA (108 avg), 35.2 C, 1355 mA
08/25/2010 11:05:06 [INFORMATION] batt: 99%, 4153 mV, 137 mA (140 avg), 35.2 C, 1358 mA
08/25/2010 11:05:56 [INFORMATION] batt: 100%, 4148 mV, 87 mA (62 avg), 35.2 C, 1358 mAh
08/25/2010 11:06:47 [INFORMATION] batt: 100%, 4148 mV, 121 mA (41 avg), 35.2 C, 1364 mA
08/25/2010 11:07:37 [INFORMATION] batt: 100%, 4148 mV, 135 mA (86 avg), 35.2 C, 1366 mA
08/25/2010 11:08:33 [INFORMATION] batt: 100%, 4148 mV, 132 mA (69 avg), 35.3 C, 1368 mA
08/25/2010 11:09:25 [INFORMATION] batt: 100%, 4148 mV, 116 mA (112 avg), 35.3 C, 1369 mA
08/25/2010 11:10:15 [INFORMATION] batt: 100%, 4153 mV, 103 mA (115 avg), 35.2 C, 1371 mA
08/25/2010 11:11:05 [INFORMATION] batt: 100%, 4153 mV, 117 mA (117 avg), 35.2 C, 1371 mA
08/25/2010 11:11:55 [INFORMATION] batt: 100%, 4153 mV, 99 mA (102 avg), 35.2 C, 1372 mAh
08/25/2010 11:12:46 [INFORMATION] batt: 100%, 4153 mV, 108 mA (88 avg), 35.2 C, 1374 mAh
08/25/2010 11:13:36 [INFORMATION] batt: 100%, 4153 mV, 88 mA (67 avg), 35.2 C, 1376 mAh
08/25/2010 11:14:26 [INFORMATION] batt: 100%, 4157 mV, 94 mA (94 avg), 35.1 C, 1377 mAh
08/25/2010 11:15:16 [INFORMATION] batt: 100%, 4157 mV, 106 mA (61 avg), 35.2 C, 1377 mA
08/25/2010 11:16:06 [INFORMATION] batt: 100%, 4157 mV, 97 mA (88 avg), 35.2 C, 1379 mAh
08/25/2010 11:16:57 [INFORMATION] batt: 100%, 4157 mV, 87 mA (79 avg), 35.2 C, 1380 mAh
08/25/2010 11:17:47 [INFORMATION] batt: 100%, 4157 mV, 86 mA (87 avg), 35.2 C, 1382 mAh
08/25/2010 11:18:37 [INFORMATION] batt: 100%, 4138 mV, 78 mA (85 avg), 35.2 C, 1382 mAh
08/25/2010 11:18:37 [INFORMATION] batt: charging BATTOFF [FULL]
08/25/2010 11:19:27 [INFORMATION] batt: 100%, 4143 mV, 0 mA (0 avg), 35.2 C, 1382 mAh
08/25/2010 11:20:17 [INFORMATION] batt: 100%, 4143 mV, 0 mA (0 avg), 35.1 C, 1382 mAh
08/25/2010 11:21:07 [INFORMATION] batt: 100%, 4143 mV, 0 mA (0 avg), 35.0 C, 1382 mAh

the driver is artificially limiting the charger and cutoff at 80mA. the battery wont pull more capacity than it can take, which is why we see the mA values slowly reduce lower and lower on their own.

that is the theory anyway, and i take full responsibility for me blowing up my phone! (it wont though:D)
[Nexus One Android Development] pershoot:
http://droidbasement.com/nexus/kern...-cm_2635.3-oc-uv-xtra-btn-aud-ram-neon_fp.zip
[Nexus One Android Development] RogerPodacter:
thanks a million, sorry for being difficult!

i'll report back right away.
[Nexus One Android Development] pershoot:
how do things look?
[Nexus One Android Development] RogerPodacter:
so far so good, totally normal charging. however i am only at 84%, so have to watch it like a hawk from this point foward to see how it functions.

here's the current log though, looking normal.

08/25/2010 14:50:41 [INFORMATION] batt: 70%, 3928 mV, 108 mA (423 avg), 30.6 C, 956 mAh
08/25/2010 14:50:41 [INFORMATION] batt: charging OFF
08/25/2010 14:50:45 [INFORMATION] batt: charging FAST
08/25/2010 14:51:31 [INFORMATION] batt: 71%, 3972 mV, 470 mA (584 avg), 31.1 C, 964 mAh
08/25/2010 14:52:22 [INFORMATION] batt: 71%, 4016 mV, 550 mA (485 avg), 31.5 C, 971 mAh
08/25/2010 14:53:12 [INFORMATION] batt: 72%, 4035 mV, 699 mA (537 avg), 32.0 C, 980 mAh
08/25/2010 14:54:04 [INFORMATION] batt: 73%, 4035 mV, 746 mA (690 avg), 32.2 C, 990 mAh
08/25/2010 14:54:55 [INFORMATION] batt: 73%, 4040 mV, 711 mA (700 avg), 32.3 C, 1000 mA
08/25/2010 14:55:45 [INFORMATION] batt: 74%, 4040 mV, 560 mA (707 avg), 32.5 C, 1009 mAh
08/25/2010 14:56:37 [INFORMATION] batt: 75%, 4045 mV, 590 mA (650 avg), 32.6 C, 1019 mAh
08/25/2010 14:57:27 [INFORMATION] batt: 75%, 4055 mV, 690 mA (655 avg), 32.8 C, 1028 mAh
08/25/2010 14:58:17 [INFORMATION] batt: 76%, 4055 mV, 659 mA (673 avg), 33.0 C, 1038 mAh
08/25/2010 14:59:07 [INFORMATION] batt: 77%, 4060 mV, 658 mA (669 avg), 33.0 C, 1048 mAh
08/25/2010 14:59:58 [INFORMATION] batt: 77%, 4060 mV, 651 mA (640 avg), 33.0 C, 1057 mAh
08/25/2010 15:00:48 [INFORMATION] batt: 78%, 4060 mV, 638 mA (641 avg), 33.0 C, 1065 mAh
08/25/2010 15:01:38 [INFORMATION] batt: 79%, 4065 mV, 605 mA (579 avg), 33.0 C, 1075 mAh
08/25/2010 15:02:28 [INFORMATION] batt: 79%, 4070 mV, 612 mA (595 avg), 33.1 C, 1083 mAh
08/25/2010 15:03:18 [INFORMATION] batt: 80%, 4070 mV, 600 mA (606 avg), 33.1 C, 1091 mAh
08/25/2010 15:04:08 [INFORMATION] batt: 80%, 4074 mV, 587 mA (591 avg), 33.1 C, 1099 mAh
08/25/2010 15:04:58 [INFORMATION] batt: 81%, 4055 mV, 488 mA (568 avg), 33.1 C, 1107 mAh
08/25/2010 15:05:49 [INFORMATION] batt: 82%, 4079 mV, 565 mA (559 avg), 33.1 C, 1115 mAh
08/25/2010 15:06:39 [INFORMATION] batt: 82%, 4074 mV, 516 mA (539 avg), 33.0 C, 1123 mAh
08/25/2010 15:07:42 [INFORMATION] batt: 83%, 4065 mV, 465 mA (448 avg), 33.0 C, 1131 mAh
08/25/2010 15:08:32 [INFORMATION] batt: 83%, 4026 mV, 233 mA (411 avg), 33.2 C, 1136 mAh
[Nexus One Android Development] RogerPodacter:
getting close...

08/25/2010 15:35:57 [INFORMATION] batt: 94%, 4114 mV, 200 mA (153 avg), 35.2 C, 1284 mAh
08/25/2010 15:37:01 [INFORMATION] batt: 94%, 4123 mV, 271 mA (241 avg), 35.2 C, 1288 mAh
08/25/2010 15:37:52 [INFORMATION] batt: 95%, 4123 mV, 271 mA (176 avg), 35.5 C, 1291 mAh
08/25/2010 15:38:53 [INFORMATION] batt: 95%, 4114 mV, 184 mA (139 avg), 35.5 C, 1294 mAh
08/25/2010 15:39:44 [INFORMATION] batt: 95%, 4123 mV, 235 mA (169 avg), 35.2 C, 1297 mAh
08/25/2010 15:40:34 [INFORMATION] batt: 95%, 4133 mV, 255 mA (237 avg), 35.2 C, 1300 mAh
08/25/2010 15:41:24 [INFORMATION] batt: 95%, 4118 mV, 149 mA (206 avg), 35.2 C, 1302 mAh
08/25/2010 15:42:14 [INFORMATION] batt: 96%, 4118 mV, 228 mA (158 avg), 35.2 C, 1305 mAh
08/25/2010 15:43:10 [INFORMATION] batt: 96%, 4133 mV, 232 mA (196 avg), 35.2 C, 1308 mAh
08/25/2010 15:44:01 [INFORMATION] batt: 96%, 4133 mV, 214 mA (167 avg), 35.1 C, 1312 mAh
[Nexus One Android Development] RogerPodacter:
well it worked by shutting off properly at 20mA. but it didnt get as high as i had hoped. however something funny happened with the sudden drop in current_mA of 10mA:

08/25/2010 15:59:33 [INFORMATION] batt: 98%, 4138 mV, 140 mA (80 avg), 34.7 C, 1345 mAh
08/25/2010 16:00:23 [INFORMATION] batt: 100%, 4143 mV, 145 mA (155 avg), 34.7 C, 1364 mA
08/25/2010 16:01:13 [INFORMATION] batt: 100%, 4133 mV, 85 mA (139 avg), 34.7 C, 1366 mAh
08/25/2010 16:02:03 [INFORMATION] batt: 100%, 4148 mV, 113 mA (98 avg), 34.7 C, 1368 mAh
08/25/2010 16:02:54 [INFORMATION] batt: 100%, 4123 mV, 10 mA (42 avg), 35.0 C, 1369 mAh
08/25/2010 16:02:54 [INFORMATION] batt: charging BATTOFF [FULL]
08/25/2010 16:03:25 [INFORMATION] batt: charging OFF [FULL]
08/25/2010 16:03:29 [INFORMATION] batt: charging BATTOFF [FULL]
08/25/2010 16:03:44 [INFORMATION] batt: 100%, 4118 mV, 0 mA (-28 avg), 35.1 C, 1369 mAh

could have been a random fluke drop off? i'll try another test, then abandon if necessary.
[Nexus One Android Development] pershoot:
20 may not be a good margin.

how about 40?

ill look in to the timeout issue.
[Nexus One Android Development] RogerPodacter:
Yes I'll try 40. We really have to find out why 80 mA was used in the old code. What justification? Because the current AOSP driver removed that current check completely. So why was it there originally, and why did Google remove it now? And if we put it back in, what effect does that have?

It all depends on why Google put it there in eclair, and why its removed now in froyo.
[Nexus One Android Development] dvgrhl:
Wow you guys have been busy while I was at work. I'm headed home now, so Roger I can compile any code changes you want as well. I'd like to add some additional output to the battery_log. I can also remove the status_reg check if you want to test that.
[Nexus One Android Development] RogerPodacter:
Nice:-). Well I'm not sure its safe to remove the stature reg check. Unless do we know what its doing. Is it writing the new status to address 0x80 whether battery_status is 1 or 0? Or true or else?

Does that direct the battery register in anyway to tell the battery when its full charge or not full charge? What I'm getting at is has the previous 80 mA condition been artificially limiting true full charge by flipping the status_reg bit prematurely anytime the battery hits less than 80 mA? Or is that crazy talk...

Cause its my theory that the battery will take charge until current_uA stops completely at zero mA. So if all this time 0x80 has been set to full charge too early, then we end up our current situation...
[Nexus One Android Development] pershoot:
can u pls test the 40 (link above you).

the TIMEOUT is coming from not getting a proper status, i believe. i could put a udelay in there right before the case is invoked. that may sort it.

if (di->status.battery_full == 1)

di->last_charge_seen = di->last_poll;

else if (di->last_charge_mode != CHARGE_OFF &&

check_timeout(di->last_poll, di->last_charge_seen, 60 * 60)) {

if (di->last_charge_mode == CHARGE_BATT_DISABLE) {

/* The charger is only powering the phone. Toggle the

* enable line periodically to prevent auto shutdown.

*/

di->last_charge_seen = di->last_poll;

pr_info("batt: charging POKE CHARGER\n");

di->charge(0, 0);

udelay(10);

di->charge(1, source == CHARGE_FAST);

} else {

/* The charger has probably stopped charging. Turn it

* off until the next sample period.

*/

charge_timeout = true;

charge_mode = CHARGE_OFF;

}

}

.............

case CHARGE_OFF:

di->charge(0, 0);

ds2784_set_cc(di, true);

if (temp >= TEMP_CRITICAL)

pr_info("batt: charging OFF [OVERTEMP]\n");

else if (di->status.cooldown)

pr_info("batt: charging OFF [COOLDOWN]\n");

else if (di->status.battery_full)

pr_info("batt: charging OFF [FULL]\n");

else if (charge_timeout)

pr_info("batt: charging OFF [TIMEOUT]\n");

else

pr_info("batt: charging OFF\n");

break;
[Nexus One Android Development] RogerPodacter:
Pershoot, I'll test 40mA but I just left work so when I get home tonight.

The timeout, its probable that this timeout issue has been here the whole time. I just never paid attention to it before. If you think you can fix it I will test it.
[Nexus One Android Development] Markdental:
What kernel did you use to do that?
[Nexus One Android Development] RogerPodacter:
I'm still using the 20 mAh kernel. But I wouldn't just go using it like normal. It should be tested much more. That was just the first good result, was it a fluke? We gotta test more.
[Nexus One Android Development] pershoot:
looking at your log, im hoping 40 will cure that erratic behavior at the end, and still allow it to reach the edge of max.
[Nexus One Android Development] Markdental:
Pershoot. Have you built the 40 into any of your current .35 kernels?
[Nexus One Android Development] dvgrhl:
So, reading this log and the other one you posted, it seems like those sudden drops (first one to 10 mA, this one to 9 mA) are what stopped the charging - which is what we want since that is < 20 mA. In this instance, it didn't get a sudden drop as soon as the other time, so while the battery reported 100% it was still allowed to charge.

So my question, would it be better to use di->status.current_avg_uA instead? That way any one drop won't cause the condition, but if there are a significant number over the time span (less than 60s I believe) then that would indicate to stop charging. We could even set it at something a little higher like 40 mA to start with. Thoughts?
[Nexus One Android Development] pershoot:
not for public consumption. just testing in this thread. link is few posts up.
[Nexus One Android Development] RogerPodacter:
Well the first one I did, I used the phone continuously the whole time to monitor. But that causes load placed on the battery. That makes the current very erratic and drop when it shouldn't.

The second one I let the phone charge with screen off, and then at the very end I turned it on to check. And that's when the current dropped which shut off the charge.

So yes, using average would probably be a better parameter to use for sure.
[Nexus One Android Development] RogerPodacter:
Yes 40 mA might be the perfect one. Butremember the current dropped like that cause I used it non stop. If I leave it idle it is very smooth and linear.

Also, the idea is lithium batteries only pulls as much current as it needs. So really we want the charge to stop when current stops pulling. So I don't think there's worry about over charging, as the ds2784 chip has over volt protection and will not allow over charging no matter what software we write.

But I thought that 20 mA might be a good safety buffer just to test.

We really need to see why Google did this, and then removed it in the current driver (we are adding this current check back in for this testing, is that ok long term?). Cause I think it reduced all our battery's full charge point.
[Nexus One Android Development] pershoot:
well... we shall see from the current-uA 40 test. once it hits that low (+/-), the charging should stop. im just thinking of worst case scenarios here and should something not work properly, that the battery would continue to take some charge, causing issues (however large or small they may be).

i will try to flash sooon and test as well.
[Nexus One Android Development] RogerPodacter:
Pershoot if you have the time you read the ds2784 fuel gauge data sheet I posted earlier. It explains everything about our battery and how complex it is and what it does.we need more tests, but it really should protect itself, I'd bet on it.

And check out the link to palm pre thread, they use same ds2784, and they are able to pull register data to see the true full capacity, battery age, over volt number, all of it. We need to do the android equivalent and find the learn mode register to re calibrate our batteries:-)
[Nexus One Android Development] RogerPodacter:
This is great, unplugged for 45 min with display on, and still at 97%.
[Nexus One Android Development] dictionary:
This thread is so full of WIN.
[Nexus One Android Development] dictionary:
Judging from your posts, I assume still the
[Nexus One Android Development] dvgrhl:
If you used current_avg_ua, then little spikes down to ~10 mA like have been seen so far won't prematurely stop the charging, and you could still leave it around 40 mA avg. You could also code in a safety net to protect things just in case, something like:

if ((di->status.status_reg & 0x80) &&
((di->status.current_avg_uA/1000) <= 40) &&
(di->status.percentage == 100)) {
di->status.battery_full = 1;
charge_mode = CHARGE_BATT_DISABLE;
} else if((di->status.current_avg_uA/1000) <= 10) ||
((di->status.current_avg_uA/1000) <= 20)) {
di->status.battery_full = 0;
}

[edit] In that else if statement it really should be = 1, not =0.
[Nexus One Android Development] pershoot:
how bout this:

if ((di->status.percentage < 99) ||

((di->status.current_uA/1000) > 80)) {

di->status.battery_full = 0;

}

/* Modified check function, based on original HTC Source.

* Added current_uA check (relates to 1400mAh capacity check)

*/

if ((di->status.status_reg & 0x80) &&

((di->status.current_avg_uA/1000) <= 40) &&

(di->status.percentage == 100)) {

di->status.battery_full = 1;

charge_mode = CHARGE_BATT_DISABLE;

}

edit: typo, missing parentheses and current_avg_uA