View Single Post
  #861  
Old 2010-05-14, 12:56
joerg_rw's Avatar
joerg_rw joerg_rw is offline
 
Join Date: Mar 2010
Location: SOL 3
Posts: 2,222
Thanks!: 3,399
Thanked 12,651 Times in 1,970 Posts
Default slightly off topic - make N900 charge without bme

first draft for putting bq24150 into fastcharge mode at a reasonable charge end voltage, and keep it in charge mode until battery is full:

Code:
i2cset -y -m 0x77 2 0x6b 0x04 0xc9;
# next register 0x03 is device ID, always 4b and r/o; so we skip to 0x04
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; 
i2cset -y -m 0xc0 2 0x6b 0x00 0x00; 

# tickle watchdog, while status indicates 'charging from wallcharger'
while [ $(i2cget -y 2 0x6b 0x00) = 0x90 ] ; do 
   sleep 28; 
   # reset watchdog timer:
   i2cset -y -m 0x80 2 0x6b 0x00 0x80; 
done
echo "charging finished, status(reg0)=$(i2cget -y 2 0x6b 0x00)"
above code not yet tested, but should result in

Code:
Nokia-N900-02-8:~# ~user/i2c/i2cdump -y -r 0-4 2 0x6b
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 90 c8 8c 4b c9                                     ???K?
which is what bme sets bq24150 to, during normal charge process

Usual disclaimer: this is addressed to developers only, who exactly understand the above code. ENDUSERS STAY AWAY


cheers
jOERG

Last edited by joerg_rw; 2010-05-14 at 13:13.
The Following 18 Users Say Thank You to joerg_rw For This Useful Post: