look at kernel source file /Kernel/drivers/power/max8997-charger.c, line 171:
Code:
static int max8997_set_charging_current(struct chg_data *chg, int chg_current)
{
struct i2c_client *i2c = chg->max8997->i2c;
int ret;
u8 val;
if (chg_current < 200 || chg_current > 950)
return -EINVAL;
[COLOR=Red][B]val = ((chg_current - 200) / 50) & 0xf;[/B][/COLOR]
dev_info(chg->dev, "%s: charging current=%d", __func__, chg_current);
ret = max8997_update_reg(i2c, MAX8997_REG_MBCCTRL4,
(val << MBCICHFC_SHIFT), MBCICHFC_MASK);
if (ret)
dev_err(chg->dev, "%s: fail to write chg current(%d)\n",
__func__, ret);
return ret;
}
above we can see that charging rate is calculated as [x * 50 + 200] with x being the bit set on lines 220 & 229:
Code:
static int max8997_enable_charging_x(struct chg_data *chg, int charge_type)
{
struct i2c_client *i2c = chg->max8997->i2c;
int ret;
u8 val, mask;
/* enable charging */
if (charge_type == POWER_SUPPLY_CHARGE_TYPE_FAST) {
/* ac */
dev_info(chg->dev, "%s: TA charging", __func__);
/* set fast charging current : [COLOR=DarkRed]650mA[/COLOR] */
ret = max8997_update_reg(i2c, MAX8997_REG_MBCCTRL4,
[B] [COLOR=Red](9 << MBCICHFC_SHIFT), MBCICHFC_MASK);[/COLOR][/B]
if (ret)
goto err;
} else if (charge_type == POWER_SUPPLY_CHARGE_TYPE_TRICKLE) {
/* usb */
dev_info(chg->dev, "%s: USB charging", __func__);
/* set fast charging current : [COLOR=DarkRed]450mA [/COLOR]*/
ret = max8997_update_reg(i2c, MAX8997_REG_MBCCTRL4,
[COLOR=Red][B](5 << MBCICHFC_SHIFT), MBCICHFC_MASK);[/B][/COLOR]
if (ret)
goto err;
} else {
dev_err(chg->dev, "%s: invalid arg\n", __func__);
ret = -EINVAL;
goto err;
}
/* set auto stop disable */
ret = max8997_update_reg(i2c, MAX8997_REG_MBCCTRL6,
(0 << AUTOSTOP_SHIFT), AUTOSTOP_MASK);
if (ret)
goto err;
/* set fast charging enable and main battery charging enable */
val = (1 << MBCHOSTEN_SHIFT) | (1 << VCHGR_FC_SHIFT);
mask = MBCHOSTEN_MASK | VCHGR_FC_MASK;
ret = max8997_update_reg(i2c, MAX8997_REG_MBCCTRL2, val, mask);
if (ret)
goto err;
return 0;
err:
dev_err(chg->dev, "%s: max8997 update reg error!(%d)\n", __func__, ret);
return ret;
}
the bits 9 & 5 above set AC charging to 650mA (9*50+200) and USB charging to 450mA (5*50+200).
Battery Monitor Widget says that my phone charges at 200mA with display on, which makes sense once you assume that phone runs off usb (sucks about 250mA w/ display on) and uses the rest of available 450mA to actually charge the battery (200mA).
so there ya go, to get faster charge either get a different usb cable (d-/d+ pins shortened, or fit a 200k resistor there) or change those 9 & 5 bits to 15 and recompile the kernel to increase charging to full 950mAh. of course, your computer's usb port will not have enough power so instead use either a wall charger or use one of those usb cables that connect to 2 usb ports simultaneously and enjoy speedy charging. oh, and do watch the temperatures as i'm assuming super-charging will heat up your phone in no time
oh, and one more thing. while you're digging though the source, check out /Kernel/drivers/misc/max8997-muic.c, lines 90 to 113:
Code:
/* MAX8997 MUIC CHG_TYP setting values */
enum {
/* No Valid voltage at VB (Vvb < Vvbdet) */
CHGTYP_NO_VOLTAGE = 0x00,
/* Unknown (D+/D- does not present a valid USB charger signature) */
CHGTYP_USB = 0x01,
/* [COLOR=DarkRed]Charging Downstream Port[/COLOR] */
CHGTYP_DOWNSTREAM_PORT = 0x02,
/* [COLOR=DarkRed]Dedicated Charger (D+/D- shorted)[/COLOR] */
CHGTYP_DEDICATED_CHGR = 0x03,
/* [COLOR=DarkRed]Special 500mA charger, max current 500mA[/COLOR] */
CHGTYP_500MA = 0x04,
/* [COLOR=DarkRed]Special 1A charger, max current 1A[/COLOR] */
CHGTYP_1A = 0x05,
/* [COLOR=DarkRed]Reserved for Future Use[/COLOR] */
CHGTYP_RFU = 0x06,
/* [COLOR=DarkRed]Dead Battery Charging, max current 100mA[/COLOR] */
CHGTYP_DB_100MA = 0x07,
CHGTYP_MAX,
CHGTYP_INIT,
CHGTYP_MIN = CHGTYP_NO_VOLTAGE
};
from this i can assume that our phones technically can charge with rates up to 1000mA depending on what cable and/or adapter you use
Very good find, if you had found this yourself. But increasing the charging rate than what Samsung actually put it at will probably have some type of result, like you said overheating. But maybe developers could add this to their kernals, with an option to change charging rate (for speedy charges in certain situations, to slower more stable charges such as at night).
Going up to 1000 IMO is pointless. The difference between that and 950 is barely noticeable. I'd say it would cut maybe .2 hours off a full charge cycle. That's probably a generous estimate.
Our phones, using the wall charger, take around 6 hours for a full charge cycle. This being due to the 450-500 mAh current from the wall charger (don't have it with me so I can't look). This obviously is unacceptable as we've all discovered. So an increase to 750-800 mAh should be plenty. The phone WILL get pretty warm but nothing we haven't experienced in other models. That would drop the charge time to 2.8-2.7 hours.
Also, it would be nice to see kernel developers utilize the trickle charge so we can unplug our phones with a 100% charge, not 97%.
My rambling aside, nice find!
Really nice find
Yes I found it myself. Took a lot of digging through kernels logs and source code but it was worth it.
Here is an idea. Instead of permanently forcing hight current charging i'd love to see devs implement a dynamic rates, where one could change the rate just like we can change cpu & gpu speeds. Anyone up for SetCPU-like system for charging?
Using the stock samsung charger that came with the phone I'm testing, the rates appear dependent on how drained the battery is. If I drain the battery down to 10% and start charging from there, Battery Monitor Widget estimates at 1000 mA give or take a little. As the battery starts getting charged, Battery Monitor Widgets records the charging rate at reduced values. It ends around 260 mA or 180 mA, I forget which, would need to look back at the logs. If I start at 60%, the rate starts off lower, with the same charger.
So I think these are probably max values and there is a separate mechanism to determine actual charging rates based on battery levels.
Somebody mentioned trickle charge. Lol That reminded me of the cluster **** that topic created back in the OG EVO forums back in the days.
Sent from my Verizon Samsung Galaxy S II Epic Touch 4G WTF BBQ
sfhub said:
So I think these are probably max values and there is a separate mechanism to determine actual charging rates based on battery levels.
Click to expand...
Click to collapse
That could be true. I did see many other kernel functions that dealt with how much and how fast phone charged. The ones I quoted in OP were the ones that had actual solid numbers in them.
I'll grab my linux box tomorrow (can't do sooner) and will recompile the kernel with the changes I mentioned in OP, just to see what it does. Fingers are crossed that my phone insurance covers melted phones haha
My Battery charge very long time from 99% to 100%
but when took off the charger when it's fully charged it drops down to 99% directly...
anybody has this same problem?
zelduy said:
My Battery charge very long time from 99% to 100%
but when took off the charger when it's fully charged it drops down to 99% directly...
anybody has this same problem?
Click to expand...
Click to collapse
that's not a problem. it'd be a problem if it were to drop directly to 90% or even 95%. 99% is normal.
I like the slow charge time, you get a better charge from it. In fact I'm going to buy a cheap charger and spare battery and use that to charger my phone like I dogs with my evo
Sent from my SPH-D710 using Tapatalk
KCRic said:
Also, it would be nice to see kernel developers utilize the trickle charge so we can unplug our phones with a 100% charge, not 97%.
My rambling aside, nice find!
Click to expand...
Click to collapse
+1,000
coming from EVO and miss the trickle charge kernals
---------- Post added at 11:36 PM ---------- Previous post was at 11:35 PM ----------
flyboy1100 said:
I like the slow charge time, you get a better charge from it.
Sent from my SPH-D710 using Tapatalk
Click to expand...
Click to collapse
yeh strange, like i charged my phone from my laptop's usb,took forever, but when it was full, it was FULL. No instant drop in % when disconnect
SayWhat10 said:
+1,000
coming from EVO and miss the trickle charge kernals
---------- Post added at 11:36 PM ---------- Previous post was at 11:35 PM ----------
yeh strange, like i charged my phone from my laptop's usb,took forever, but when it was full, it was FULL. No instant drop in % when disconnect
Click to expand...
Click to collapse
Correct, that cheap external battery charger I had for my evo had a usb port that only output 350ma and I really like that, it may take 6hrs to charge but since I only plug out in when I go to sleep that is ok
Sent from my SPH-D710 using Tapatalk
Read the description.
I have to update the stuff in my kernel to the newer gingerbread sources.
Maybe someone will be able to port it over to the Epic Touch (my kernel is for the OG Epic).
=]
SayWhat10 said:
yeh strange, like i charged my phone from my laptop's usb,took forever, but when it was full, it was FULL. No instant drop in % when disconnect
Click to expand...
Click to collapse
Really? I think I'm gonna try it.. coz it's really weird to drop directly to 99% after I disconnected it, its instantly drop.. my other phone could stay 100% for a quiet long time..
HondaCop said:
Somebody mentioned trickle charge. Lol That reminded me of the cluster **** that topic created back in the OG EVO forums back in the days.
Sent from my Verizon Samsung Galaxy S II Epic Touch 4G WTF BBQ
Click to expand...
Click to collapse
Haha I remember that too. It seemed to spread like wild fire. Man that was lame
::bump::
Any upd8s, new developments, anything about this?
Yeah, I'm kind of curious about any updates too.
Buy 1A wall charger and all your charging problems solved. That's what I ended up doing.
Takes about 1.5-2 hours from very low to charge. 5A charger
Sent from a yakju GSGN
Related
After using snap kernel for a while and being able to see the rate my evo is charging I figured it would be easy to find another battery program that would let me know how many milliamps my phone is consuming and the rate it is charging, but I have yet to find one after downloading a hundred off the market... someone throw me a bone here
Apple? I assume you mean app
063_XOBX said:
Apple? I assume you mean app
Click to expand...
Click to collapse
I don't know, I got a trackball kiwi and a screen orange. What's wrong with a battery apple?
user7618 said:
I don't know, I got a trackball kiwi and a screen orange. What's wrong with a battery apple?
Click to expand...
Click to collapse
Wow. I've been having a crappy day and you just had me lolling my ass off.
Thanks. That's good comedy.
daneurysm said:
Wow. I've been having a crappy day and you just had me lolling my ass off.
Thanks. That's good comedy.
Click to expand...
Click to collapse
You're quite welcome.
skydeaner said:
After using snap kernel for a while and being able to see the rate my evo is charging I figured it would be easy to find another battery program that would let me know how many milliamps my phone is consuming and the rate it is charging, but I have yet to find one after downloading a hundred off the market... someone throw me a bone here
Click to expand...
Click to collapse
Well if you want to do math calculations, you could use JuicePlotter I guess.
We know 100% = 1500 mAH.
So if your phone charged 10% (150 mAH) in 1 hour, then the charging rate was 150 mA.
So basically you can come up equation like this:
Charge rate (in milliamps) = (%age charged * 15) / (time charged in minutes / 60)
Simplifying:
Charge rate (in milliamps) = %age charged * 900 / time charged in minutes
Edit: Sorry made a math boo boo.
if you have aLogcat it gives the current in there, other than that I think there was an app someone was working on in one of the other forums but I dont think there is anything in the market for that.
try searching in the nexus or desire forums
On market, Current Widget.
frifox said:
On market, Current Widget.
Click to expand...
Click to collapse
you sir.... Thanks.
AzN1337c0d3r said:
Well if you want to do math calculations, you could use JuicePlotter I guess.
We know 100% = 1500 mAH.
So if your phone charged 10% (150 mAH) in 1 hour, then the charging rate was 150 mA.
So basically you can come up equation like this:
Charge rate (in milliamps) = (%age charged * 15) / (time charged in minutes / 60)
Simplifying:
Charge rate (in milliamps) = %age charged * 900 / time charged in minutes
Edit: Sorry made a math boo boo.
Click to expand...
Click to collapse
I know my ohm's law circle, thanks though.
Edit:
That sounded *****y. seriously though, thanks for your time, but I am a computer tech, have been an electrician, have done some engineering work, so I already could figure it like that, I just wanted a specific readout at any given time.
Hello.
The battery reading is constant 36.8°C, im used to that. Anyway, yesterday i was observing the terminal while charging the battery to see whats going on with adjusting mAh and units, and noticed that aux0 value from ds2746 is getting lower as the battery gets warmer.
so i stuffed the digital thermometer probe under the battery and made a few notes while heating ans cooling the phone:
aux0....temp
268.....27,8
343.....20,2
365.....18,3
390.....15,5
then i played with the numbers a bit and got this:
546 - aux0 *0,1 = temp (close value)
it was a crappy cheap thermometer so the values could be wrong. should repeat the measurment with more acurate thermometer and make more than 4 notes....
Could the kernel be moded so the temperature reading would be from the upper formula?
Edit:
it's 596 - aux0 * 0,1, that should show the same as in WM
Thanks for the research! I've been meaning to do this for quite a while, but haven't. Out of curiosity, I have two questions:
a) What battery do you have?
b) What is aux1 reading for you?
aux1 jumps arround from 61 to 67 right after boot. After that its quite stable. 64 when charging, 62 when not charging.
Batteries are one 1350mAh and one dissassembled, using the controller with random battey packs, currently 750mAh
I'll update the kernel to use your data:
Temp C = (596 - aux0)/10.
I'll make the 596 a new kernel parameter: temp_calibration = 596.
If you come up with a better equation, please let me know.
The kernel will do integer math, not floating point, and it reports tenths of degrees, so with your equation it's simply C*10 = 596 - aux0, which is nice.
I wonder if perhaps the value HTC intended was 600?
It's a small difference, 596 just came from measuring, an the thermometer isn't pin point acurate. 600 should make less than 0.5C difference.
Okay, I just pushed the kernel change.
New kernel parameter, temp_calibration = 600.
Temp (C) * 10 = temp_calibration - aux0.
Coming soon to a kernel near you.
Thank you again V3rt!g(o) for the data.
Im running CM9 final, and im not sure if this a rom issue or something else:
I have 2 batteries, the stock, and a mugen battery.
The stock should theoretically take ~3 hours to charge(650mah/hour and its 1850mah), and the mugen is 3900mah, so around 6 hours for that.
My battery was at 7%(the mugen), and after 14 hours, was at 89% while on the AC adapter. The stock battery, is only going at about 20%/hour, so MUCH slower than it should be.
Ive noticed this for a week now, is it possible that its an issue with CM, or something physically wrong with the phone. Ive used multiple cables and 2 batteries now, and they all charge very slowly.
Just wondering if someone else has this issue before i try a reflash.
Rekzer said:
Im running CM9 final, and im not sure if this a rom issue or something else:
I have 2 batteries, the stock, and a mugen battery.
The stock should theoretically take ~3 hours to charge(650mah/hour and its 1850mah), and the mugen is 3900mah, so around 6 hours for that.
My battery was at 7%(the mugen), and after 14 hours, was at 89% while on the AC adapter. The stock battery, is only going at about 20%/hour, so MUCH slower than it should be.
Ive noticed this for a week now, is it possible that its an issue with CM, or something physically wrong with the phone. Ive used multiple cables and 2 batteries now, and they all charge very slowly.
Just wondering if someone else has this issue before i try a reflash.
Click to expand...
Click to collapse
Are you using the Samsung charger that came with the phone?
Also are you charging through ac or usb from comp. Apps running in the background can slow charging as well. Charging specs vary based on circumstance. I'm in cm 9 stable with darkside latest kernel and cpu sleeper i can charge from completely dead to full in about 3-4hrs roughly.
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
this is how the kernel defines charging...
Code:
if (enable) { /* Enable charging */
switch (info->cable_type) {
case CABLE_TYPE_USB:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
val_chg_current.intval = 500; /* USB 500 mode */
info->full_cond_count = USB_FULL_COND_COUNT;
info->full_cond_voltage = USB_FULL_COND_VOLTAGE;
break;
case CABLE_TYPE_AC:
case CABLE_TYPE_CARDOCK:
case CABLE_TYPE_UARTOFF:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 900mA, output : 900mA */
val_chg_current.intval = 900;
info->full_cond_count = FULL_CHG_COND_COUNT;
info->full_cond_voltage = FULL_CHARGE_COND_VOLTAGE;
break;
case CABLE_TYPE_MISC:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 700, output : 700mA */
val_chg_current.intval = 700;
info->full_cond_count = FULL_CHG_COND_COUNT;
info->full_cond_voltage = FULL_CHARGE_COND_VOLTAGE;
break;
case CABLE_TYPE_UNKNOWN:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 450, output : 500mA */
val_chg_current.intval = 450;
info->full_cond_count = USB_FULL_COND_COUNT;
info->full_cond_voltage = USB_FULL_COND_VOLTAGE;
break;
default:
dev_err(info->dev, "%s: Invalid func use\n", __func__);
return -EINVAL;
}
as you can see if your using a cheap generic charger from china 'CABLE_TYPE_UNKNOWN' it is only going to charge at 450mA, in comparison to the Samsung charger 'CABLE_TYPE_AC:' that came with the phone that will charge at 900mA.. and charging from USB 'CABLE_TYPE_USB' will only charge at 500mA
thederekjay said:
this is how the kernel defines charging...
Code:
if (enable) { /* Enable charging */
switch (info->cable_type) {
case CABLE_TYPE_USB:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
val_chg_current.intval = 500; /* USB 500 mode */
info->full_cond_count = USB_FULL_COND_COUNT;
info->full_cond_voltage = USB_FULL_COND_VOLTAGE;
break;
case CABLE_TYPE_AC:
case CABLE_TYPE_CARDOCK:
case CABLE_TYPE_UARTOFF:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 900mA, output : 900mA */
val_chg_current.intval = 900;
info->full_cond_count = FULL_CHG_COND_COUNT;
info->full_cond_voltage = FULL_CHARGE_COND_VOLTAGE;
break;
case CABLE_TYPE_MISC:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 700, output : 700mA */
val_chg_current.intval = 700;
info->full_cond_count = FULL_CHG_COND_COUNT;
info->full_cond_voltage = FULL_CHARGE_COND_VOLTAGE;
break;
case CABLE_TYPE_UNKNOWN:
val_type.intval = POWER_SUPPLY_STATUS_CHARGING;
/* input : 450, output : 500mA */
val_chg_current.intval = 450;
info->full_cond_count = USB_FULL_COND_COUNT;
info->full_cond_voltage = USB_FULL_COND_VOLTAGE;
break;
default:
dev_err(info->dev, "%s: Invalid func use\n", __func__);
return -EINVAL;
}
as you can see if your using a cheap generic charger from china 'CABLE_TYPE_UNKNOWN' it is only going to charge at 450mA, in comparison to the Samsung charger 'CABLE_TYPE_AC:' that came with the phone that will charge at 900mA.. and charging from USB 'CABLE_TYPE_USB' will only charge at 500mA
Click to expand...
Click to collapse
Huh...something learned everyday lol
Been working on building kernels and other software, this code actually made so much sense it's awesome lol
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
Someone in the CM thread had me check cpu spy, my phone never sleeps, it just sits at 384 min..
As for the charger, its the samsung one, and a generic usb cable from china...it used to charge faster on one of these cables then recently slowed down ALOT.
Hmmm...so you use the sleeper app or the script? The app has never worked for me, but the script works fantastically. Have you tried just simply flashing back to stock and starting over. Could be something with a recent update, could be your media server is running rampant. Have you use gsam battery monitor to see what things are running?
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
Rekzer said:
Someone in the CM thread had me check cpu spy, my phone never sleeps, it just sits at 384 min..
As for the charger, its the samsung one, and a generic usb cable from china...it used to charge faster on one of these cables then recently slowed down ALOT.
Click to expand...
Click to collapse
There device will never "deep sleep" while charging. I am also running CM9 stable and my device is charging without issue. I would try to wipe and flash again. Avoid restoring any system data. If that doesn't remedy your issue, it's either the device itself or the batteries and or cable. Try a different cable. Try a different battery. There are only a few variables, just need to isolated what is the culprit.
thederekjay said:
There device will never "deep sleep" while charging.
Click to expand...
Click to collapse
+1 what he said lol
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
EnigmaticGeek said:
Huh...something learned everyday lol
Been working on building kernels and other software, this code actually made so much sense it's awesome lol
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
Click to expand...
Click to collapse
Nice. That is only a few lines from sec_battery.c. That file contains 4433 lines of code
thederekjay said:
Nice. That is only a few lines from sec_battery.c. That file contains 4433 lines of code
Click to expand...
Click to collapse
Yeah, the kernel codes are long as i learned by decompiling the stock one...
That was initial reaction, but it makes sense as i go through the code.
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
EnigmaticGeek said:
Yeah, the kernel codes are long as i learned by decompiling the stock one...
That was initial reaction, but it makes sense as i go through the code.
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
Click to expand...
Click to collapse
You can't really decompile a kernel. If you're referring to a boot.img, that is not the same as the kernel (zimage) kernel source consists of 10's of thousands of files with each file consisting from a few lines up to thousands of lines of code.
thederekjay said:
You can't really decompile a kernel. If you're referring to a boot.img, that is not the same as the kernel (zimage) kernel source consists of 10's of thousands of files with each file consisting from a few lines up to thousands of lines of code.
Click to expand...
Click to collapse
Yeah i haven't quite gotten the terminology down pat, still relatively new to this type of environment. Working each day to get up there with you guys
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
Rekzer said:
Someone in the CM thread had me check cpu spy, my phone never sleeps, it just sits at 384 min..
As for the charger, its the samsung one, and a generic usb cable from china...it used to charge faster on one of these cables then recently slowed down ALOT.
Click to expand...
Click to collapse
I think it does charge pretty slow, but I'm used to the sensation... It would charge really fast. Does yours need a reboot after removing the usb to go into deep sleep?
thederekjay said:
Nice. That is only a few lines from sec_battery.c. That file contains 4433 lines of code
Click to expand...
Click to collapse
You gotta love c language xD
Sent from my SAMSUNG-SGH-T989 using Tapatalk 2
Battery is at 100% atm. TDJ was right, taking it off the charger enabled it to sleep.
If i still have issues, Ill try a wipe after nandroiding. So far ive tried 2 cables, 2 batteries, PC and Samsung chargers. So its software or phone now. Ill try tomorrow and let ya know!
Noticed this as well..although I'm on Jedi v6..doesn't matter what cable or source. I'll have to test, but it also seems like deep sleep can't be obtained after unplugging cable until reboot. Is that normal? Or kernal issue?
Sent from my SGH-T989 using xda app-developers app
md95 said:
Noticed this as well..although I'm on Jedi v6..doesn't matter what cable or source. I'll have to test, but it also seems like deep sleep can't be obtained after unplugging cable until reboot. Is that normal? Or kernal issue?
Sent from my SGH-T989 using xda app-developers app
Click to expand...
Click to collapse
Hmmm...that's not normal no. Mine will deep sleep almost immediately after being removed from the charger. I wouldn't guess a kernel issue, but it is possible. Have you ever achieved deep sleep with a reboot?
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
EnigmaticGeek said:
Hmmm...that's not normal no. Mine will deep sleep almost immediately after being removed from the charger. I wouldn't guess a kernel issue, but it is possible. Have you ever achieved deep sleep with a reboot?
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
Click to expand...
Click to collapse
Oh yes, it deep sleeps just fine. I did a quick charge test and it does go into sleep fine now..although I didn't charge to 100%..I'll have to try that next. This is a new phone and rom for me, as I was using cm7 on a mytouch4g before acquiring the s2
Sent from my SGH-T989 using xda app-developers app
md95 said:
Oh yes, it deep sleeps just fine. I did a quick charge test and it does go into sleep fine now..although I didn't charge to 100%..I'll have to try that next. This is a new phone and rom for me, as I was using cm7 on a mytouch4g before acquiring the s2
Sent from my SGH-T989 using xda app-developers app
Click to expand...
Click to collapse
Errr...that was supposed to ask, without a reboot have you ever achieved deep sleep lol. (Friggin auto-correct!) But you answered that, hopefully it was simply the rom settling into the phone. But it should still sleep even at 100%
sent from my T989 full of CM awesomeness and a touch of Venom from the Darkside!!
Hi everyone, finally I managed to calibrate my aged battery of HTC Desire. Anyway I'm stuck at this point:
theGanymedes said:
ADDENDUM:
Since the battery age value is somehow rewritten to 94% when you charge your phone off, I recommend editing the full40 value accordingly. In order to do that, first start and successfully complete a learning cycle; and then reboot (or power on/off). After this, you shall see the age value of your battery (say XX%).
Now, you should calculate "real" mAh value using this:
Code:
Code:
REAL Capacity = "Real" Full40 Value (1452 in Stock etc.) x Age Percentage (0.XX)
Now, we must recalculate the "fake" Full40 value and write it to EEPROM, so that our battery will be always calibrated (even charged off):
Code:
Code:
"Fake" Full40 = Real Capacity / 0.94
Write this value to Full40 assignment area in the Learn Prep app in the application, press Save and you're done.. Congrulatulations, you just calibrated your battery, even when it's charged off.
NOTE: Since some internal calculations also use Full40 value, I recommend you to write rounded to next value, rather than truncated.
Click to expand...
Click to collapse
That is simple math
But I want to make sure I'm not doing wrong - then being obliged to recalibrate again.
My real full40 value is 1452mAh, and Age% is 100%
Real capacity = 1452 x 0,100 = 145,2 ==> Is that so?
Fake Full40 = 145,2 / 0,94 = 155
Now I shall go to the LearnPrep tab and set that 155 value to Full40. Is that possible to set such a low value?
I'm sure I'm mistaking some calc :|
I guess the right calc for Fake Full40 is (1452x100)/94 = 1545.
Tell me please, and sorry for the nobbish question.
And thanks in advance.
Also I can't get this:
theGanymedes said:
Capacity (to set) * 15 (Rsns value) / 6.25 (constant) = AC register value
Click to expand...
Click to collapse
Where the hell do I know that "Capacity (to set)" number?
Maybe I am stupid, maybe my english comprehension is not perfect, maybe both.
But please, help me!
I think these LiION batteries reserve a certain percent of power to stop them fully discharging as that is quite bad for Li-IOn.
So for example, when you see 1% battery power there might actually be 6% left but the phone will power off to avoid damaging the battery.
I used an app on the app store to recalibrate my battery [Battery Calibrator
Jon Richards] based on a thread here somewhere. It worked and I went from gettign about 8 hours where the phone would power off to about 16 hours and I'd still have 10 - 20% left.
However, I think I might not have followed the instructions correctly and allowed the battery to discharge too much, damaging it. Last week my battery died - this could of course be coincidence but err on teh side of caution when playing around with Li-ion thresholds.
I may have also taken other steps - I can't remember - the whole adventure of prolonging battery life was quite a chore
Properly calibrating battery which gives you accurate readings and more battery life is
Follow these steps
1. Switched On phone charge till 100% and wait 1 hour more don't unplug charger, after that time unplug charger and power off your phone.
2. Charge your phone switched off till 100% then unplug charger
3. Switch on phone and again follow step 1, then unplug charger and reboot into recovery/advanced settings/ wipe battery status. Now turn on your phone again and follow step 1 and that's all.
Your battery will be properly calibrated enjoy friends
Sent from my GT-S5660 using xda premium
rakijaman said:
Properly calibrating battery which gives you accurate readings and more battery life is
Follow these steps
1. Switched On phone charge till 100% and wait 1 hour more don't unplug charger, after that time unplug charger and power off your phone.
2. Charge your phone switched off till 100% then unplug charger
3. Switch on phone and again follow step 1, then unplug charger and reboot into recovery/advanced settings/ wipe battery status. Now turn on your phone again and follow step 1 and that's all.
Your battery will be properly calibrated enjoy friends
Sent from my GT-S5660 using xda premium
Click to expand...
Click to collapse
http://www.google.com/url?sa=t&sour...1oCIBA&usg=AFQjCNHUrHK2SdcwIXgUdqFMed-PZcDJ7Q
i think u best read this
Sent from my HTC Desire
100% age after successful calibration
KengoNakamura said:
Hi everyone, finally I managed to calibrate my aged battery of HTC Desire. Anyway I'm stuck at this point:
That is simple math
But I want to make sure I'm not doing wrong - then being obliged to recalibrate again.
My real full40 value is 1452mAh, and Age% is 100%
Real capacity = 1452 x 0,100 = 145,2 ==> Is that so?
Fake Full40 = 145,2 / 0,94 = 155
Now I shall go to the LearnPrep tab and set that 155 value to Full40. Is that possible to set such a low value?
I'm sure I'm mistaking some calc :|
I guess the right calc for Fake Full40 is (1452x100)/94 = 1545.
Tell me please, and sorry for the nobbish question.
And thanks in advance.
Click to expand...
Click to collapse
I also calibrated successfully and age was 100% .. so according to fake full40 formula it needs to be reset as 1452/0.94 = 1545 ;
can you answer what you did or how you approached further .. because 1545 does not seem to be proper value to be set
kindly reply...
Hello,
What's your current Battery Capacity of your HTC10?
It's supposed to be 3000mAh right? Tought so myself, but maybe my battery has been used too much already, or it never was that great.
How to find out?
If you have a Terminal app installed, simply type:
Code:
dumpsys batteryproperties
If you're on a Computer with ADB running, connect the phone and type:
Code:
adb shell
dumpsys batteryproperties
You will get a result similar to this:
Code:
htc_pmeuhl:/ $ dumpsys batteryproperties
ac: 1 usb: 0 wireless: 0 current_max: 0 voltage_max: 0
status: 2 health: 2 present: 1
level: 57 voltage: 4282 temp: 382
current now: -2140032
current now: -2141
Full charge: 2769000
And you see my point? Full charge: 2'769mAh That's like quite a bit too low.
So i asked a friend and he got this:
Code:
htc_pmewl:/ # dumpsys batteryproperties
ac: 0 usb: 1 wireless: 0 current_max: 0 voltage_max: 0
status: 2 health: 2 present: 1
level: 81 voltage: 4121 temp: 375
current now: 220183
current now: 220
Full charge: 3049000
Now then dear XDA we need as many results as possible, so if you can spare 5 minutes, please type this command and share your result.
And also mention how old your device is.
Mine is bought in May so almost a year old now.... and has seen some heavy usage^^
Update:
Using this trick you can RESET the Battery Sensor.
Black-FR said:
For those of you, with lower values.
Switch off the device.
Then push and hold all three buttons (power / volume up / volume down) for approximately 1-2 minutes.
This will reset the battery calculation.
In my case, I had a value of 27.... and after the reset, I'm back to the 3049000.
Click to expand...
Click to collapse
But Reset does not mean calibrate. 3049 is the Stock value set by manufacturer.
If you wan't to Calibrate the Battery i recommend:
using this Reset
Drain it until it reaches 0% and force shutdown the phone
Charge it for more than 3hours. 1.5h would be until 100%, let it connected for at least 2 more hours.
Drain it again until it reaches 0% and force shutdown.
Charge it again for more than 3hours.
After that, try the Command again and see the result.
Production Date related to Low Battery?
Let's see if the Devices with Low Battery are anyhow related
According to LlabTooFeR deciphering Serial Number goes like this:
FS YMD ID XXXXX
Where:
FS – Factory Site, it’s divided into
HT & TY: Taiwan Taoyuan A factory
FA & 5A: Taiwan Taoyuan B factory
SZ & SC: China SuZhou
SH & KC: China ShangHai KQ factory
HC & KD: China ShangHai KD factory
LC: LongCheer (Mainly ODM/MTK devices)
CC: CEI (Mainly ODM/MTK devices)
YMD – Year/Month/Day
Y (Year): the last digit of the year in which the product was produced
M (Month): 1-9=Jan.-Sep.; A-C=Oct.-Dec.
D (Day): 1-9=1-9; A-Z=10-31
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
1 2 3 4 5 6 7 8 9 A B C D E F G H J K L M N P R S T V W X Y Z
ID – Device ID
For example M9 is YJ, M8 is WM, M7 is W9, Desire EYE is Y8 and etc…
XXXXX – is the identification number of the device produced in the specific day. It’s calculated in decimal system.
So lets, take as example serial number FA 4AY Y8 04757 and figure how this is working:
FA – Taiwan Taoyuan B factory
4AY – 2014/10/30
Y8 – Desire EYE
04757 – this is 04757 unit produced on the Taiwan Taoyuan B factory 2014/10/30
Click to expand...
Click to collapse
Source: http://llabtoofer.com/2015/12/14/htc-devices-serial-number-explanation/
So mine was produced in Taiwan Taoyuan B, 2016 April 12th, BN should be HTC10 Device 01XXX (1000 devices Privacy should be enough)
Thanks for your cooperation,
Greetz
haldi
Code:
ac: 0 usb: 0 wireless: 0 current_max: 1500000
status: 3 health: 2 present: 1
level: 40 voltage: 3764 temp: 305
current now: 373075
Purchased in June 2016.
Sent from my HTC 10
I get this:
Code:
ac: 0 usb: 1 wireless: 0 current_max: 0 voltage_max: 0
status: 5 health: 2 present: 1
level: 100 voltage: 4405 temp: 200
current now: -102691
current now: -124
Full charge: 3049000
Purchased July 19th
Code:
ac: 0 usb: 1 wireless: 0 current_max: 0 voltage_max: 0
status: 2 health: 2 present: 1
level: 63 voltage: 3955 temp: 332
current now: -266874
current now: 304
Full charge: 3049000
Last minute pre-order
Code:
ac: 0 usb: 1 wireless: 0 current_max: 0 voltage_max: 0
status: 2 health: 2 present: 1
level: 51 voltage: 3830 temp: 370
current now: -289762
current now: 583
Full charge: 3091000
Purchased Dec 2016.
Holy crap it's degrading....
Code:
htc_pmeuhl:/ # dumpsys batteryproperties
ac: 0 usb: 0 wireless: 0 current_max: 0 voltage_max: 0
status: 3 health: 2 present: 1
level: 98 voltage: 4286 temp: 282
current now: 269316
current now: 336
Full charge: 2492100
Anyone knows of a way to reset battery sensor stats on this phone?
The dry to absolutely zero and shutdown then charge is the next thing I'm trying.
When I type the command into terminal app, I get unknown error. Do I need root for that to work?
Haldi4803 said:
Holy crap it's degrading....
Code:
htc_pmeuhl:/ # dumpsys batteryproperties
ac: 0 usb: 0 wireless: 0 current_max: 0 voltage_max: 0
status: 3 health: 2 present: 1
level: 98 voltage: 4286 temp: 282
current now: 269316
current now: 336
Full charge: 2492100
Anyone knows of a way to reset battery sensor stats on this phone?
The dry to absolutely zero and shutdown then charge is the next thing I'm trying.
Click to expand...
Click to collapse
This is the exact thing I was affraid will happen. I think this degradation is due to quick charge. Sure, it's nice to have your 3000 mAh battery charged in under one hour, but the price of it? Battery degradation... I don't belive HTC went Samsung on us, giving us faulty batteries
Hmmm.....
[email protected]_pmeuhl:/ $ dumpsys batteryproperties
dumpsys batteryproperties
ac: 0 usb: 1 wireless: 0 curren_max: 1500000
status: 2 health: 2 present: 1
level: 92 voltage: 4265 temp: 272
current now: -281523
[email protected]_pmeuhl:/ $
Click to expand...
Click to collapse
What does this say now? I do not receive full charge line as output. ... maybe mine is not fully charged? Could it be it shows you the capacity (mah) remaining scaled according to your current charging level.
If this was the case maybe the battery shows 100 % while it was not completely cycled to 100 percent due to quick charge. Maybe you want to try when it is really full.
Correct me if i am wrong, please. I will try the command again in a while when mine reaches 100 percent from USB. Then im going to enter the output result here:
Reading here about Quick Charge 3 in the meantime:
http://www.androidauthority.com/quick-charge-3-0-explained-643053/
Thats what i meant. The last few values might take much longer until it is "really" full. That might take up to an hour then.
Now it shows me the green LED (still no such Line):
ac:0 usb: 1 wireless: 0 current max: 1500000
status: 5 health: 2 present: 1
level: 100 voltage: 4404 temp: 250
current now: -228880
Click to expand...
Click to collapse
So i can not join your poll?
Full charge: 3049000, 7months old.
Mostly i charge via PC, rarely i use quick charger. Its just pure logic that quick charger shortens battery life, short and long term, its just how batteries work..
donkeykong1 said:
This is the exact thing I was affraid will happen. I think this degradation is due to quick charge. Sure, it's nice to have your 3000 mAh battery charged in under one hour, but the price of it? Battery degradation... I don't belive HTC went Samsung on us, giving us faulty batteries
Click to expand...
Click to collapse
I think you are right. That's why I recommend to use a non-QC-3.0-charger (such as one by Anker with IQ charge for example). And/or I have found some code lines anywhere. I have searched for it in the forum, but I haven't found it anymore and I didn't remember who has made it. I have only re-written the code lines a bit, added some lines and created a script. So this is not my work, I would give credits to the person who was written the lines, but unfortunately, I don't remember where I found this.
So what does this script do? It limits the charging current to 800mA. That's why the phone will charge slower of course, but the battery will be spared. Another thing is that the phone will only charge till 90%, which spares the battery as well.
You can always run this script in a terminal with root access. Run it just before you start charging and you will be fine. I haven't managed to get it run automatically unfortunately. By all means, enjoy! (and remove the .txt at the end)
htc_pmewl:/ $ dumpsys batteryproperties
ac: 0 usb: 1 wireless: 0 current_max: 0 voltage_max: 0
status: 2 health: 2 present: 1
level: 66 voltage: 3967 temp: 202
current now: -299528
current now: 234
Full charge: 3049000
mine is 8 months old and I always use quick charge at home and in the car, I do not think this issue is related to quickcharging the device, might be a bad batch of batteries maybe ....
Fullcharge: 3045000
Bought May 2016...were the first available.
Used quick charger maybe to times...but most of the times I use my SuperCharger with 1.5A output on my laptop.
Since I debug/develop a lot on it, it's connected there nearly the whole day when I'm at home.
RogerF81 said:
I think you are right. That's why I recommend to use a non-QC-3.0-charger (such as one by Anker with IQ charge for example). And/or I have found some code lines anywhere. I have searched for it in the forum, but I haven't found it anymore and I didn't remember who has made it. I have only re-written the code lines a bit, added some lines and created a script. So this is not my work, I would give credits to the person who was written the lines, but unfortunately, I don't remember where I found this.
So what does this script do? It limits the charging current to 800mA. That's why the phone will charge slower of course, but the battery will be spared. Another thing is that the phone will only charge till 90%, which spares the battery as well.
You can always run this script in a terminal with root access. Run it just before you start charging and you will be fine. I haven't managed to get it run automatically unfortunately. By all means, enjoy! (and remove the .txt at the end)
Click to expand...
Click to collapse
Those values doesnt seam to be correct, HTC has one extra digit
echo 800000 > /sys/class/power_supply/battery/constant_charge_current_max
800 000 while mine shows curent 290 000 0
So that script needs fixing if you attempt to use it
EDIT:
Also changing values doesnt work, it immediately reverts to original values..
ivicask said:
Those values doesnt seam to be correct, HTC has one extra digit
echo 800000 > /sys/class/power_supply/battery/constant_charge_current_max
800 000 while mine shows curent 290 000 0
So that script needs fixing if you attempt to use it
EDIT:
Also changing values doesnt work, it immediately reverts to original values..
Click to expand...
Click to collapse
No, this is completely right and as I want it to be. 2900000 means 2,9A means QC 3.0. But I want to limit it to 0,8A, means 800 mA, means 800000 cause this is a safe value for batteries. This is ok:good:
The advised charge rate of an Energy Cell is between 0.5C and 1C; the complete charge time is about 2–3 hours. Manufacturers of these cells recommend charging at 0.8C or less to prolong battery life.
Click to expand...
Click to collapse
(http://batteryuniversity.com/learn/article/charging_lithium_ion_batteries) (C means current, its unit is 1A)
And for me it's working correctly. This script runs every 3 minutes and therefore the values should persist. Don't know why this isn't working for you...
https://twitter.com/TeamVenomROMs/status/820945706814939136
retweet pls (-:
RogerF81 said:
No, this is completely right and as I want it to be. 2900000 means 2,9A means QC 3.0. But I want to limit it to 0,8A, means 800 mA, means 800000 cause this is a safe value for batteries. This is ok:good:
And for me it's working correctly. This script runs every 3 minutes and therefore the values should persist. Don't know why this isn't working for you...
Click to expand...
Click to collapse
Im connected to PC, and output shows 290 000 0, man if im drawing 3amps from PC it would explode
Ampere shows around 300mA of charging current..
But also im on stock kernel that may be a reason it doesnt work for me.
BTW, did you take in account that its not all about current, it uses different voltages also depending on what type of charging is done, you can see this differences on original htc charger.(think there is 3 different voltages and currents for charging)
ivicask said:
Im connected to PC, and output shows 290 000 0, man if im drawing 3amps from PC it would explode
Ampere shows around 300mA of charging current..
But also im on stock kernel that may be a reason it doesnt work for me.
BTW, did you take in account that its not all about current, it uses different voltages also depending on what type of charging is done, you can see this differences on original htc charger.(think there is 3 different voltages and currents for charging)
Click to expand...
Click to collapse
Well, then Ampere shows it right:good: So where do you see that output?
And yeah but I can only influence the charging rate, not the voltages. And I think the battery itself always uses the same voltage, only the charger's voltage can change as you mentioned (5V/2.4A or 9V 1,7A for example). And this is all about the output of for example 24W which stays constantly. All in all, the kernel controls the charging current and I want it to be limited. On top, only charging current should influence the battery health, as this is the amount of elecrical enegery which "flows into" the battery.
But yeah, I think it's complicated:laugh:
I think M7 had both voltage and current charge control, so the original charger from my M7 should charge my 10 just fine. If QC proves to have a bad impact on battery capacity, I'll simply use the good old M7's charger ?
donkeykong1 said:
I think M7 had both voltage and current charge control, so the original charger from my M7 should charge my 10 just fine. If QC proves to have a bad impact on battery capacity, I'll simply use the good old M7's charger
Click to expand...
Click to collapse
Voltage charge control? How does this work?
I learned that voltage is the amount of "current" that could be transported and that the amperage is the amount of "current" which is actually transported. So I don't know how the voltage could be controlled, it should be limited to hardware and the "kernels" of the charger and the device could change it as required.