Reply
Thread Tools
Posts: 50 | Thanked: 36 times | Joined on Aug 2010
#1
Hello guys,

I have been battling with weird charging problems on my phone. The phone will show as charging but in fact it will NOT be charging and instead slowly depleting the battery. Finally last weekend I sat down determined to get to the bottom of this. I haven't been able to narrow down exactly why it happens. This is where you guys might be able to help but I am fairly certain I have a solution for the time being.

My current setup involves using the N900 as a motorcycle GPS. The screen is always on, sometimes for hours so constant charger capable of relatively high current draw is absolutely a must.

I inspected and looked at the whole charging system of the motorcycle, everything appeared normal. I purchased a charger capable of 2A @ 5V and tested it. It is in fact capable of delivering the rated current with acceptable voltage drop. I tested it. Everything appeared normal as well. Finally i set my eyes on the N900 because initially I did not believe it was the culprit.

Just to be on the safe side, I shorted the D+ and D- pins of the USB with a solid wire. I don't use the USB port for anything else other than charging. The ground pin on the USB was further connected to the ground plane and finally the VBUS on the USB connector was connected to the fuse with a direct wire connection. I glued everything in place in order to avoid any potential issues due to vibration.

I started looking at low lever I2C scripts capable of reading the charging and gas gauge ICs of the N900.

What I found out is that sometimes the BME will somehow instruct the battery charging chip to limit the charging current at 100mA. This is not adequate to power a screen and CPU intensive application such as GPS.
Through monitoring the current going through the battery gas gauge I was able to narrow down when the phone is actually charging and when it just appears to be charging.

I started out with a script made by jeorg_rw:
http://talk.maemo.org/showpost.php?p=658278

and monitoring the charging current with bq27200.sh script by shadowjk

eventually I realize that no matter what I plugged in I can coax the phone into charging with only a part of jeorg_rw's script:
Code:
i2cset -y -m 0xff 2 0x6b 0x02 0x8c;
# 0x8c = 3v5 + .640 + .040 + .020 = 4V200, BE CAREFUL and DON'T CHANGE
# unless you know what you're doing. 4V2 is ABS MAX!


i2cset -y -m 0xff 2 0x6b 0x01 0xc8;
echo "Charing parameters set..."

I run this and I DO keep BME running through the whole ordeal. I have NO idea how this affects BME and BMEs interactions and internals but it does not SEEM to cause any issue. It is entirely possible that BME and this crude I2C interaction can clash and cause unpredictable results.DO NOT do anything you are unsure of...This is at best a "hack" !

The first line sets the max charge voltage and the second one starts the charging process with no current limit..(hmmm)

I created myself a small script that lets me execute this whole ordeal easily every time I plug in a random charger.

/home/user/adjust_current.sh
Code:
#!/bin/sh

# gain superuser rights.

if [ `id -u` != 0 ] ; then
    exec sudo gainroot <<EOF
exec sh $0 $*
EOF
   exit $?
fi

# put your code below

i2cset -y -m 0xff 2 0x6b 0x02 0x8c;
# 0x8c = 3v5 + .640 + .040 + .020 = 4V200, BE CAREFUL and DON'T CHANGE
# unless you know what you're doing. 4V2 is ABS MAX!


i2cset -y -m 0xff 2 0x6b 0x01 0xc8;
echo "Charing parameters set..."
I also created an icon so I can easily start this:
/usr/share/applications/hildon/adjust_current.desktop
Code:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Terminal=true
Type=Application
Name=Adjust Current
Categories=System;TerminalEmulator;
X-HildonDesk-ShowInToolbar=true
Exec=sh /home/user/adjust_current.sh
Icon=/opt/usr/share/icons/hicolor/scalable/hildon/statusarea_battery_insufficient_charging.png
I execute this "app" every time I connect it to an "eBay" style non-Nokia charger.

What is funny is, the wall charger will consistently and reliably charge the phone EVERY TIME. Maybe the ID pin is involved somehow, I am not sure and at this point in time I am 100% satisfied with my hackjob solution as it does what I want it to do and I have already spend enough time chasing this.

Do you know what might be causing the charging issues shown above? Is there a proper fix?
 

The Following User Says Thank You to quanttrom For This Useful Post:
ajack's Avatar
Posts: 288 | Thanked: 175 times | Joined on Oct 2010 @ Petaling Jaya, Selangor, Malaysia
#2
From personal experience, the charger must output between 600 to 800mhA, anything higher or lower and it stops charging. This is from my casual observation of using a low output charger and once trying to use an Apple wall-to-USB plus with a 2000mhA rating.

The best solution was to get a Blackberry charger which I use that outputs at 700mhA. I read that this was fixed in a power-kernel, but not sure where exactly I read that.
__________________
Visit my blog at http://lifewithmaemo.blogspot.com or my website at http://www.renegade-uiq.com
 

The Following 2 Users Say Thank You to ajack For This Useful Post:
Posts: 1,417 | Thanked: 2,619 times | Joined on Jan 2011 @ Touring
#3
I have encountered this issue using my N900 with a bicycle hub dynamo/eWerk charger system, in the end I put a switch that I flip to disconnect/reconnect the charging and short on the data pins ever few minutes. Crude as can be but works.
The N900 will restrict itself the the previous amps once it detects any voltage drop, sometimes it will drop to zero and it will not reset until disconnected. I dug around a few years ago and tried add a reset script to the BME every 5 min to renegotiate the charging amps but it didn't work and killed charging/USB completely until I reverted.
I don't have the skills to make it work but I think it would be easy for someone in the know, much as bypassing the shorted pins in code would probably be doable. OTOH it might be a hardware limitation in the BME, I don't know.
This app could be useful to many, consider putting it on the unstable repos.

Last edited by biketool; 2013-09-11 at 07:37.
 
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#4
Originally Posted by ajack View Post
.. between 600 to 800mhA ...
... with a 2000mhA rating.

... outputs at 700mhA...
s/mhA/mA/g, please.
 

The Following User Says Thank You to reinob For This Useful Post:
Posts: 31 | Thanked: 31 times | Joined on Jan 2013 @ USA
#5
I've been frustrated by this for a while and these are the main problems I've ran into:

1. There are a LOT of crappy chargers and cables out there. You will have to hunt for good ones. Don't trust the badge that it's a good charger/cable
2. A broken USB port can't be fixed by buying a new charger/cable.
3. The default BME does do the right thing, as far as I have seen. Though it will not let you use the last bits of power from your battery, it will try to lengthen the overall lifespan of the battery and any chargers hooked up to it.

I've been buying chargers and charger cables to see what actually works and what doesn't, with mixed results. Right now I have exactly one good wall charger, made by LG (5.1V 700mA), and its cable. I also have exactly one good charging/data cable, which was made by Nokia (CA-101D, the 8cm short cable). Every single other charger/cable I have is lacking, including my Nokia AC10C, whether it be due to poor construction, or wear.

I even recently bought one of those phony A1265s chargers (the little cube Apple charger) to see how bad they really were, and let me tell you, these do indeed suck. Though it says 5V 1A it can't really supply that much before it starts drooping a lot.

I would suggest people should be careful when using those special charger scripts. BME is trying its best not to fry USB ports and cause a fire, but yes it can guess wrong and tends to be pessimistic (some USB hubs can supply all the current that the N900 needs, but since it does not have D+/D- shorted, the N900 won't try.)
 
Posts: 50 | Thanked: 36 times | Joined on Aug 2010
#6
I have been using the AC10C for years and it is still functioning well. I really wonder what makes ur unit act funky....

It is possible that the charge control IC in the N900 sees a dip in the voltage and reduces the current but I haven't spend a lot of time investigating that. I don't even recall if the charging chip had some kind of undervoltage protection.

When I tested the car charger I didn't do transient load testing. It is possible that the car charger voltage dips when a heavy load is applied.

I have a long motorcycle trip coming up at the end of the month and I will report back. The best kind of testing is real world testing
 
Posts: 31 | Thanked: 31 times | Joined on Jan 2013 @ USA
#7
The N900 does stop trying to charge if it notices it's not gaining ground when charging, apparently. Most of my testing have been with a hacked version of the charge21 script (I hacked out the setting of current and used it solely for monitoring charge current.) My (apparently) worn AC10C could not get past 400mA along with a lot of other cables (some can't get past 200-300mA) - and all of these that can't get past 500mA are not capable of allowing the N900 to boot when the battery is flat. That A1265 fake Apple charger has the same problem - I couldn't get over 400mA out of it.

I need to jury rig a good 5V bench supply that I can always hook up my phone to...
 
Reply


 
Forum Jump


All times are GMT. The time now is 07:00.