Steps To Change 18650 Cells and Reset Batteries
Steps To Change 18650 Cells and Reset Batteries
This article records my steps to change 18650 cells for ECS G401 laptop. The model is EM-
G400L2S, 11.1V 4800mAH.
vcc, vcc, nc, scl, sda, temp, nc, gnd, nc, gnd
I use Arduino Uno R3 with default SDA,SCL which are identical to A4 A5, other similar
atmega 328/168 derivative will be ok, modifying *.ino file for pin definition.
1
Connect arduino SDA,SCL and GND with corresponding pin of batteries. Some
batteries have SYS_PRES pin, connected to GND through a resister.
To compile and upload SmartBatteryHack arduino firmware, using official arduino IDE. First
download SoftI2CMaster https://github.com/felias-fogg/SoftI2CMaster ,Put this library
inside the "<Your installed dir>\Arduino\libraries\SoftI2CMaster" folder, for me: K:\
Program Files (x86)\Arduino\libraries\SoftI2CMaster. Then compile and upload firmware
normally.
2
Though there is a pre-compiled SmartBatteryHack.exe in \GUI\SmartBatteryHack\
SmartBatteryHack\bin\Debug, you can run “c:\Windows\Microsoft.NET\Framework\v3.5\
MSBuild SmartBatteryHack2008.sln” to compile GUI. If v3.5 fail, try v4.0 with other *.sln file.
Looking for datasheet for seal state, the result is register 0x2f:
Pack Status and Pack Configuration (0x2f)
This function returns the pack status and pack configuration registers. The pack status register
contains a number of status bits relating to bq2084 operation. The pack status register is the least
significant byte of the word. The pack configuration register reflects how the bq2084 is
configured as defined by the value programmed in Pack Configuration in DF 0x28.
The pack status register consists of the following bits:
b7 b6 b5 b4 b3 b2 b1 b0
PRES EDV2 SS VDQ AFEFAIL PF CVOV CVUV
PRES The VDQ bit indicates if the present discharge
The PRES bit indicates that the bq2084 has cycle is valid for an FCC update.
been inserted into the system. 0 Discharge cycle not valid
0 bq2084 is out of the system 1 Discharge cycle valid
1 bq2084 is inserted into a system PF
SS The PF bit indicates that the bq2084 PF Flag
The SS bit indicates the seal state of the has been set. It is cleared only when the PF
bq2084. Flag has been cleared
0 The bq2084 is in the unsealed state 0 bq2084 PF Flag = 0x00
1 The bq2084 is in the sealed state 1 bq2084 PF Flag = 0x66
VDQ
3
Ok, 0x06b0=0b0000 0110 1011 0000 the least significant byte of the word = 1011 0000
4. Unseal batteries
Next we unseal it by unseal key. The default unseal key is 2084 7a43, stored in data flash 0xf8
0xf9 0xf6 0xf7,and another default unseal key collected from internet is 0414 3672. This key can
be modified by manufacture, so just for reference.
To using unseal key, we need writing this key to register 0x00 (ManufactureAccess).
Open GUI program in computer, find
Tools->register: select 00, write: entre 2084, click word button,
Tools->register: select 00, write: entre 7a43, click word button,
Verification:
4
Read register 2f:
Tools->register: select 2f, read:(readonly, the value read shown here) , click word button, the read
value is:0x0690=0b11010010000 the least significant byte of the word = 1001 0000, bit 5 is 0
unsealed.
5
Cycle Count Initialization
Cycle Count DF 0x0c-0x0d stores the initial value for the CycleCount() function. It should be
programmed to 0x0000.
Memory Map
The following table shows the memory map for the data flash. It shows the default programming
for the bq2084-V133. The default programming reflects example data for a 3s2p Li-ion battery
pack with a 0.02-Ω sense resistor. The data flash must be reprogrammed to meet the
requirements of individual applications.
DATA FLASH ADDRESS NAME LI-ION DATA
HIGH BYTE LOW BYTE EXAMPLE MSB LSB
0x32 0x33 Design Capacity 7200 mAh 1c 20
0x36 0x37 Full Charge Capacity 7200 mAh 1c 20
0x0c 0x0d Cycle Count 0 00 00
0x38 0x39 Cycle Count Threshold 5200 mAh 14 50
We can read or write a byte of data flash by 0x50 0x51 0x52 command in UNSEAL mode or FULL
ACCESS mode.
The command definition:
Writing to Data Flash With Command 0x50
The user may use Command 0x50 to write individual bytes up through 0xff only. The first
parameter is the data byte, the second is the address.
For example, writing a 16-bit integer requires two writes:
lError = WriteSMBusWord(&H50, yDataMS, yAddress)
lError = WriteSMBusWord(&H50, yDataLS, yAddress + 1)
6
lError = ReadSMBusWord(&H52, yDummy, yDataMS)
//set flash address for ls data byte
lError = WriteSMBusWord(&H51, yDummy, yAddress + 1)
//read ls byte
lError = ReadSMBusWord(&H52, yDummy, yDataLS)
lDataWord = (256 * CLng(yDataMS)) + yDataLS
Cycle Count:
Write: 51 000C Write: 51 000D
Read: 52 -> CC_HB Read: 52 -> CC_LB
After writing to data flash, we should verify again using 0x51 0x52 command, and then directly
read equivalent register, if two methods got the same value, we succeed!
7
8
Pic 1: Read reg 0x18: 0x12C0(DC=4800mAH),
Pic 2,3 Value 0x12(DC_High Byte),from data flash 0x32, 0xC0(DC_Low Byte) from data flash 0x33
9
Pic 4: Read reg 0x10: 0x12C0(FCC=4800mAH),
Pic 5,6: Value 0x12(FCC_High Byte),from data flash 0x36, 0xC0(FCC_Low Byte) from data flash
0x37
10
11
Pic 7: Read reg 0x17: 0x0000(CC=0),
Pic 8,9: Value 0x00(CC_High Byte),from data flash 0x0c, 0x00(CC_Low Byte) from data flash 0x0d
8. Something to note
About melted-fuse and PF.
The fuse controlled by both bq2084 and bq29401.
Table 12. SAFE Activation Conditions (from bq2084 datasheet)
CONDITION ACTIONS
Voltage() > Safety Over Voltage (DF 0x6b and 0x6c), SOV and PF
set
Temperature() > Safety Over Temperature in Charge (DF 0x75 and 0x76) SOTC and PF
set
Temperature() > Safety Over Temperature in Discharge (DF 0x77 and 0x78) SOTD and
PF set
When Miscellaneous Configuration (0x2a) bit 13 AC is set, and the number of AFE and PF
Analogue Front End (bq29312) failures has reached the AFE Fail Limit (DF 0xe4) set
When VCELL (MAX) – VCELL (MIN) > Cell Imbalance Threshold (DF 0xee, 0xef) during CIM and PF
charging set
If charge FET is off, and charge current greater than FET Fail charge current stored in FETF and PF
DF 0x125−0x126 for the time determined by FET Fail time in DF 0x129, or if discharge set
12
FET is off and discharge current greater than FET Fail discharge current stored in DF
0x127−0x128 for the time determined by FET Fail time in DF 0x129.
The PFIN input has detected a low state for PFIN Time in consecutive seconds, as PF set
determined by DF 0x120 PFIN,
NOTE: SAFE output activated and PF Flag set only if enabled by PF Config (DF 0x0x11f)
In general, bq2084 will melt fuse when over-voltage, over-temperature (over-current), broken-
bq29312, Imbalance-cell, Fail-FET.
Bq29401, a cell voltage monitor, will melt the fuse when the cell voltage is abnormal. Its
datasheet describe the correct connexion sequences.
To prevent incorrect output activation the following connection sequences must be used. 4-Series
Cell Configuration
• VC1(=VDD) → VC2 → VC3 → VC4 → GND or
• GND → VC4 → VC3 → VC2 → VC1(=VDD)
3-Series Cell Configuration
• VC1(=VC2=VDD) → VC3 → VC4 → GND or
• GND → VC4 → VC3 → VC1(=VC2=VDD)
2-Series Cell Configuration
• VC1(=VC2=VC3=VDD) → VC4 → GND or
• GND → VC4 → VC1(=VC2=VC3=VDD)
So when changing 18650 cell, the correct way of dis-assembly is to cut the wires one-by-one
going from + to - and when inserting new cells solder the wires - first and go up one-by-one to +.
RULES: ONE BY ONE
If the fuse is melted and set Permanent Failure, result in without voltage output. The key to clear
PF is 2673 1712 stored in data flash 0x123 0x124 0x121 0x122. Try to write them to 0x00 under
unseal mode or full access mode.Open GUI program in computer, find
Tools->register: select 00, write: entre 2673, click word button,
Tools->register: select 00, write: entre 1712, click word button,
PS: I did not meet PF situation, so this step I did not test by myself.
There are two methods to write and read flash. The simplest method uses commands 0x50, 0x51
and 0x52 as described above. This covers the complete range of the data flash for the bq2083
and bq2085. However, the bq2084 contains many data flash locations outside of this range
(above address 0xff). The preferred technique, for both types of devices is to read and write
entire blocks. This is generally faster if there are several locations to read and/or write. This
technique also allows full programming of the bq2084 data flash constants.
13
The flash data can be read or written with the following read/write page commands which use
the SMB Block protocol. In order to write, however, the entire block must first be read, then
edited and written back.
For the bq2083 and bq2085
0x58 64 bytes Reads/Writes data flash locations 0x0000-0x003f
0x59 64 bytes Reads/Writes data flash locations 0x0040-0x007f
0x5a 64 bytes Reads/Writes data flash locations 0x0080-0x00bf
0x5b 42 bytes Reads/Writes data flash locations 0x00c0-0x00e9
Or use:
0x60 16 bytes Reads/Writes data flash locations 0x0000-0x000f
0x61 16 bytes Reads/Writes data flash locations 0x0010-0x001f
0x62 16 bytes Reads/Writes data flash locations 0x0020-0x002f
0x63 16 bytes Reads/Writes data flash locations 0x0030-0x003f
0x64 16 bytes Reads/Writes data flash locations 0x0040-0x004f
0x65 16 bytes Reads/Writes data flash locations 0x0050-0x005f
0x66 16 bytes Reads/Writes data flash locations 0x0060-0x006f
0x67 16 bytes Reads/Writes data flash locations 0x0070-0x007f
0x68 16 bytes Reads/Writes data flash locations 0x0080-0x008f
0x69 16 bytes Reads/Writes data flash locations 0x0090-0x009f
0x6a 16 bytes Reads/Writes data flash locations 0x00a0-0x00af
0x6b 16 bytes Reads/Writes data flash locations 0x00b0-0x00bf
0x6c 16 bytes Reads/Writes data flash locations 0x00c0-0x00cf
0x6d 16 bytes Reads/Writes data flash locations 0x00d0-0x00df
0x6e 10 bytes Reads/Writes data flash locations 0x00e0-0x00e9
14
0x6a 16 bytes Reads/Writes data flash locations 0x00a0-0x00af
0x6b 16 bytes Reads/Writes data flash locations 0x00b0-0x00bf
0x6c 16 bytes Reads/Writes data flash locations 0x00c0-0x00cf
0x6d 16 bytes Reads/Writes data flash locations 0x00d0-0x00df
0x6e 16 bytes Reads/Writes data flash locations 0x00e0-0x00ef
0x6f 16 bytes Reads/Writes data flash locations 0x00f0-0x00ff
0x70 16 bytes Reads/Writes data flash locations 0x0100-0x10f
0x71 16 bytes Reads/Writes data flash locations 0x0110-0x011f
0x72 16 bytes Reads/Writes data flash locations 0x0120-0x012f
0x73 4 bytes Reads/Writes data flash locations 0x0130-0x133
Reference:
http://application-notes.digchip.com/001/1-1474.pdf
http://powergood.com.ua/forum/viewtopic.php?t=679
http://bbs.mydigit.cn/read.php?tid=2316282
https://pzxxw.com/thread-78500-1-1.html
http://www.karosium.com/2016/08/smbusb-hacking-smart-batteries.html
https://github.com/laszlodaniel/SmartBatteryHack
15
16