3 To 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
3 To 6 Cells Battery-Management System Based On bq76925 + MSP430G2xx2
ABSTRACT
This application report describes how to use bq76925 and MSP430G2xx2 to implement a
high-accuracy digital battery-management solution, which can support a complete pack
monitoring, balancing, protection, and gas gauging system for 3 to 6 series cell Lithium-
Ion / Polymer battery. This solution is designed to focus on power tool projects, while it
can be also a reference design for other similar applications.
Please send questions or comments about this template to Richard Tang (mailto:Richard-
[email protected]) or Andy He (mailto:[email protected]).
1
SLUA707
Contents
1 Features ........................................................................................................................................ 3
2 Introduction .................................................................................................................................. 3
3 Description ................................................................................................................................... 4
3.1 Major Hardware Functions and Design Guidelines ................................................................. 4
3.1.1 Cell Voltage Sense Circuits ......................................................................................... 4
3.1.2 External LDO .............................................................................................................. 5
3.1.3 SC Protection and Wake-up Circuits ........................................................................... 6
3.1.4 Voltage and Current Measurement ............................................................................. 7
3.1.5 Drivers ........................................................................................................................ 8
3.1.6 Precharge Control ....................................................................................................... 9
3.1.7 Load Removal Detection ............................................................................................. 9
3.2 MCU Software Description ................................................................................................... 10
3.2.1 MSP430G2xx2 Software Flow .................................................................................. 10
3.2.2 Accuracy ................................................................................................................... 15
3.2.3 Low-power Mode ...................................................................................................... 16
3.2.4 Over Temperature (OT) ............................................................................................ 17
3.2.5 Under Temperature (UT)........................................................................................... 18
3.2.6 Over Current (OC) .................................................................................................... 19
3.2.7 Short Current (SC) .................................................................................................... 21
3.2.8 Over Voltage (OV) .................................................................................................... 24
3.2.9 Under Voltage (UV)................................................................................................... 25
Appendix A. user.h ............................................................................................................................ 26
Figures
Figure 1. Overall Schematic ........................................................................................................... 4
Figure 2. Cell Voltage Sense Circuits ............................................................................................ 5
Figure 3. External LDO .................................................................................................................... 6
Figure 4. SC Protection and Wake-up Circuits.............................................................................. 7
Figure 5. Voltage and Current Measurement................................................................................. 7
Figure 6. Drivers .............................................................................................................................. 8
Figure 7. Precharge Control ........................................................................................................... 9
Figure 8. Load Removal Detection ............................................................................................... 10
Figure 9. Mainloop Flow................................................................................................................ 11
Figure 10. Measuring Flow ............................................................................................................. 12
Figure 11. Function Flow ................................................................................................................ 14
1 Features
To implement a high-accuracy digital battery-management solution, bq76925 + MSP430G2xx2
can support a complete pack monitoring, balancing, protection, and gas gauging system for 3 to
6 series cell Lithium-Ion / Polymer battery. This solution is designed to focus on power tool
projects, while it can also be a reference design for other similar applications.
2 Introduction
The bq76925 is a dedicated analog front end (AFE) for 3 to 6 series cell application that
provides 3 analog outputs that allow a microcontroller to easily monitor cell voltage, current, and
temperature. Cell voltages are level-shifted, scaled, and multiplexed to the VCOUT pin. Cell
current is monitored through a sense resistor placed in series with the cell stack. The voltage
across the sense resistor is amplified and driven to the VIOUT pin. The VTB pin supplies a
switched bias to stimulate a thermistor network for temperature measurement. The bq76925
supplies a 3.3-V regulated output to power the MSP430G2xx2 and an accurate 3.3-V reference
voltage for the MSP430G2xx2 analog-to-digital converter (ADC). The AFE also includes
integrated cell balancing FETs that are under control of the MSP430G2xx2. Finally, the on-board
comparator of the AFE signals an overcurrent condition to the MSP430G2xx2 for fast fault
response.
The MSP430G2xx2 series is an ultra-low-power microcontroller with one built-in 16-bit timer, a
fast 10-bit ADC with integrated reference, built-in communication capability using the universal
serial communication interface, and up to 24 I/O pins. The architecture, combined with five low-
power modes, is optimized to achieve extended battery life in portable measurement
applications. The MSP430G2xx2 application circuit is provided to read the analog signals from
the bq76925 and let the user create custom firmware based on the application code.
With the AFE of bq76925, the MSP430G2xx2 is evaluated as the host to control bq76925 by I2C
of USI module, the MSP430G2xx2 can read the data of analog signals from
bq76925 by ADC10.Then the MSP430G2xx2 can easily monitor individual cell voltages, pack
current, and temperature to achieve battery charge and discharge management. Although it is
only a 10-bit ADC result for the MSP430G2xx2, bq76925 can calibrate it into a high-accuracy
value with the particular compensated algorithmic of correction factors. For example, the ADC10
value deviation of cell voltage does not exceed 5 mV, which can strongly make this solution
outstanding in this field requirement. To make this solution more competitive, the MSP430G2xx2
is selected for its advantages of low power and low cost.
The user can choose the part number of the MSP430G2xx2 from MSP430G2x32/G2x52, as
there are eight part numbers for the different configurations, like flash size, Comparator_A+.
More software functions mean more flash size is need. The user can choose the right part
number based on the necessary functions of the MSP430G2xx2.
3 Description
This application note, which can help designers evaluate the bq76925 + MSP430G2xx2 battery-
management system, discusses the important setup and operation of the module, and contains
schematics, bill of materials, and printed circuit board layout. Before designing a battery-
management system based on the bq76925 + MSP430G2xx2 solution, designers are advised to
read the bq76925 and MSP430G2xx2 data sheet.
1
BATT+ PACK+
PAD1 1 PACK+ 1 PAD3
1 1
0.1uF R1 D1
100K
D2 Q1
R2 C1 18V
D3 ZXTP25040DFH
BZT52C4V7-7-F
MBR0540T1G 100R
D4 R50 Q2
J25
+ C2 D5 BSS84P R4
TestPoint DNP R3 1M C3 0 100K
10uF/50V wakeup circuits
BZT52C30-13-F 4.7uF/10V C4 C5 U2 MSP430G2452IPW20
R5 R7 CD4148WT 10uF R6
J26 J27 J28 J29 J30
1
1
Q9 18V
10M 2.2M 18V
BATT-
PAD2 1 0.002/1W 1% PACK- 1
1 1 PAD4
RSENS2 DVCC Q10 Q11 PACK-
IRFS3206PBF IRFS3206PBF
C18 0.1uF/50V
R49 BSS84P
0.002/1W 1% 1M C17 0.1uF/50V 1K
J24 Q15
R64 R74
CB10
D14
J4 J5 J6 J7 J8 1 2
BSS84P
TestPoint TestPoint TestPoint TestPoint TestPoint R29
J9 J10 J11 J12 J13 LOADADCIN PACK-
CB7
1 DVCC R47 CB8 R48 R46 Z1 1
47K C23 SW2 CIRCUIT BREAKER 1M 1M AZ23C5V6-7-F 2
LED3/COM1 1 2 3
SBW DVSS 1000pF EVQPE504K
3
LED2/COM2 1 2
MCU CIRCUIT BREAKER COM
CB9
47 1 20
CIN1 VCTL V3P3
RIN2 1uF 2 19
VC5 BAT SCL
3 18
47 VC6 SDA
CIN2 4 17
RIN3 VC5 VREF
1uF
VC4 5 bq76925 16
CON7 VC4 VTB
7 47 6 15
6 CIN3 VC3 VCOUT
5 RIN4 1uF 7 14
4 VC3 VC2 VIOUT
3 8 13
2 47 VC1 ALERT
1 CIN4 9 12
RIN5 VC0 SENSEP
1uF
VC2 10 11
J2 VSS SENSEN
47
CIN5
RIN6 1uF
D23 VC1
SMBJ28CA
47
CIN6
RIN7 1uF
VC0
47
CIN7
1uF
D2 Q1
R2
D3 ZXTP25040DFH
BZT52C4V7-7-F
MBR0540T1G 100R
D4
+ C2 D5
DNP R3 1M C3
10uF/50V
BZT52C30-13-F 4.7uF/10V
U1
1 20
VCTL V3P3
2 19
BAT SCL
3 18
VC6 SDA
4 17
VC5 VREF
5 bq76925 16
VC4 VTB
6 15
VC3 VCOUT
7 14
VC2 VIOUT
8 13
VC1 ALERT
9 12
VC0 SENSEP
10 11
VSS SENSEN
0.1uF R1 D1
100K
C1 18V
R50 Q2
BSS84P R4
C3 0 100K
wakeup circuits
4.7uF/10V C4 C5 U2 MSP430G2452IPW20
R5 R7 CD4148WT 10uF R6
U1 D6 0.1uF 10K
3.3K 3.3K DVCC 1 20 DVSS Q3
DVCC DVSS 2N7002E
1 20 2 19 LED1/XIN ALERT
VCTL V3P3 P1.0/A0 XIN/P2.6
2 19 SCL R8 3 18 LED0/XOUT
BAT SCL 10K P1.1/A1 XOUT/P2.7 R9 0.1uF D7
3 18 SDA 4 17 TEST 18V
VC6 SDA D21 P1.2/A2 TEST 100KC6
4 17 VREF 5 16 RST
VC5 VREF R10 P1.3/A3 RST/NMI PACK-
5 bq76925 16 THERM BAT46W 6 15
VC4 VTB 10K SDA/P1.7
P1.4/Vref /A4
6 15 VCOUT 7
LOADADCIN 14
VC3 VCOUT R11 0 P1.5/A5 SCL/P1.6
7 14 VIOUT DSG 8 13 DISP/LOADCHK
VC2 VIOUT R12 0 P2.0 P2.5
8 13 ALERT CHG 9 12 LED3/COM1
VC1 ALERT P2.1 P2.4
9 12 PRECHG 10 11 LED2/COM2
VC0 SENSEP C10 C11 C12 P2.2 P2.3
10 11
VSS SENSEN C13 C14 C8 NTC1 C9 DNPDNPDNP
10K
1uF 0.1uF 470pF 0.1uF
C3 0
4.7uF/10V C4 C5 U2 MSP430G2452IPW20
R5 R7 CD4148WT 10uF
U1 D6 0.1uF
3.3K 3.3K DVCC 1 20
DVCC DVSS
1 20 2 19
VCTL V3P3 P1.0/A0 XIN/P2.6
2 19 SCL R8 3 18
BAT SCL 10K P1.1/A1 XOUT/P2.7
3 18 SDA 4 17
VC6 SDA D21 P1.2/A2 TEST
4 17 VREF 5 16
VC5 VREF R10 P1.3/A3 RST/NMI
5 bq76925 16 THERM BAT46W 6 15
VC4 VTB 10K P1.4/Vref /A4
SDA/P1.7
6 15 VCOUT 7
LOADADCIN 14
VC3 VCOUT R11 0 P1.5/A5 SCL/P1.6
7 14 VIOUT DSG 8 13
VC2 VIOUT R12 0 P2.0 P2.5
8 13 ALERT CHG 9 12
VC1 ALERT P2.1 P2.4
9 12 PRECHG 10 11
VC0 SENSEP C10 C11 C12 P2.2 P2.3
10 11
VSS SENSEN C13 C14 C8 NTC1 C9 DNPDNPDNP
10K
1uF 0.1uF 470pF 0.1uF
PACK+ 1 2 VDRV
R13
CIRCUIT BREAKER 1M
Q4
PACK+ VDRV
Q5
C16 BSS84P
2N7002E 1M
R16 1uF/25V
VC3 R17
1K Q6 R18
Driver improvement BSS84P 2.2M CD4148WT
D11
R19
2.2M
Q8
2K R21 1K 2N7002E R22
Q7 R20 CHG 1K
R23 1K 2N7002E
DSG R24
5.1M
R25 R26
5.1M
100R
2N7002E D12 R27 R28 D13
Q9 18V
10M 2.2M 18V
Q10 Q11
IRFS3206PBF IRFS3206PBF
C18 0.1uF/50V
C17 0.1uF/50V
Figure 6. Drivers
R64 R74
BSS84P
R29
LOADADCIN PACK-
R53
1M
Q17
DVCC
2N7002E
R40
47K
DISP/LOADCHK
C22
SW1
0.1uF
EVQPE504K
Measuring Section
• Alert Measuring monitors whether there is short circuit among the batteries of pack.
• Func Ctrl controls the cell in the right status by the flag of cells.
• Balance Ctrl balances the cell current when the voltage and offset are both over range.
• Open Cell Check Ctrl checks if the cell pack was open in connect.
• LPM Check Ctrl lets the MSP430 go to sleep by checking the idle time.
• Gauging Display shows the capacity of the pack (increased number of LEDs indicates
greater capacity).
To match the different condition of protected mode, the user can also customize the parameter
which is defined in user.h (see Appendix A). For example, the threshold value.
Figure 11 shows the Function flow.
3.2.2 Accuracy
A test platform was set up with battery pack to test the measurement accuracy of cell voltage,
current, and temperature. We determined the Calculated Value by the MSP430G2 software
algorithm. See the following tables.
Cell Voltage
Current
Temperature
Ch1 = MSP430 DSG pin, Ch2 = MSP430 CHG pin, Ch3 = Voltage on NTC
Ch1 = Voltage on NTC, Ch2 = MSP430 CHG pin, CH3 = MSP430 DSG pin
Ch1 = Voltage on NTC, Ch2 = MSP430 CHG pin, Ch3 = MSP430 DSG pin
• COC: OC in charge
Set up the test platform with a DC source to charge the battery. The system detects the
charge current once in main loop. If the charge current is higher than the COC protection
threshold, the system will keep detecting it; after charge current detection exceeds the user-
defined times, CHG will be off. After 4 seconds in COC protection, CHG will be on again.
Ch1 = Voltage on sense resistor tranferred from Current, Ch2 = MSP430 CHG pin
Ch1 = MSP430 DSG pin, Ch2 = MSP430 CHG pin, Ch3 = Voltage on sense resistor
Ch1 = MSP430 DSG pin, Ch2 = MSP430 load detection pin, Ch3 = Pack–
SC threshold is 50 mV, SC delay time is 418 µs, Ch1 = MSP430 DSG pin, Ch2 = Gate of MOS,
Ch3 = Voltage on sense resistor current transferred by current
SC threshold is 50 mV, SC delay time is 90 µs, Ch1 = MSP430 DSG pin, Ch2 = Gate of MOS,
Ch3 = Voltage on sense resistor transferred by current
During SC protection, MSP430G2 simply waits for the release condition. If the load is removed,
DSG will be on after one main loop time.
Ch1 = MSP430 DSG pin, Ch2 = MSP430 load detection pin, Ch3 = Pack–
Ch1 = MSP430 DSG pin, Ch2 = Main loop count, Ch3 = Pack–
Ch1 = MSP430 DSG pin, Ch2 = MSP430 CHG pin, Ch3 = Voltage on sense resistor
Ch1 = MSP430 DSG pin, Ch2 = MSP430 CHG pin, Ch3 = Voltage on sense resistor
Appendix A. user.h
// =============================================================================
// Define the operation function for choosing
// Defined => Chosen, Undefined => Not chosen
// =============================================================================
//#define MSP430_ADC_Cal 1 //Enabled if ADC value need calculated by Gain and Offset
//#define ADC_MultSamples 1 //Enabled if ADC need sample for multiple times to get the average value
//#define PRE_RELEASE_SAMPLES 1 //Enabled if it is the prereleased samples
#define OpenCell_ADCDet 1 //Enabled if open cell need to be detected
// =============================================================================
// Define references for measurement calculations
//
// VREF_NOM : Nominal reference voltage. Set by writing REF_SEL in the CONFIG_2
// register (REF_SEL = 0, 1 => VREF_NOM = 1.5, 3.0).
// GVCOUT : Nominal cell voltage gain. Also set by writing REF_SEL in the
// CONFIG_2 register (REF_SEL = 0, 1 => GVCOUT = 0.3, 0.6) .
// GVSENSE : Current amplifier gain. Set by writing the I_GAIN bit in the
// CONFIG_1 register (I_GAIN = 0, 1 => GVSENSE = 4, 8).
// FS_CNT : ADC full-scale count. For an 'n' bit ADC, FS_CNT = pow(2,n) - 1.
// =============================================================================
#define VREF_NOM 3
#define GVCOUT 0.6
#define GVSENSE 8
#define FS_CNT 1023L
// =============================================================================
// Define fault thresholds
//
// The fault thresholds are transformed using function like macros. The trans-
// formation reduces code size by avoiding floating-point arithmetic and
// division.
//
// VC_TRANS(x) : Transforms voltage threshold. 'x' is in Volts.
// VI_TRANS(x) : Transforms current threshold. 'x' is in Volts.
// VT_TRANS(x) : Transforms temperature threshold. 'x' is in Volts.
// =============================================================================
#define VC_TRANS(x) ((unsigned int) (x * GVCOUT * 1000)) //unit mV
#define OV_THRESHValue 4.250 // OV threshold in Volts/V
#define OV_ResetValue 4.050 // OV Reset threshold in Volts
#define UV_THRESHValue 2.800 // UV threshold in Volts
#define UV_ResetValue 3.000 // UV Reset threshold in Volts
#define PreCHG_Value 2.500 //Cell voltage for Prechange in Volts
#define PreCHG_ResetValue 2.600 //Cell reset voltage for Prechange in Volts
#define CELL_BalMax 3.500 //Cell max voltage value for balance in Volts
#define CELL_BalDif 0.100 //Cell difference voltage value for balance in Volts
#define BQSleep_THRESHValue 1.500 // BQSleep threshold in Volts/V
// =============================================================================
// Define Protect condition enable times.
// Detect multiple times to confirm the protection start and keep some delay.
// =============================================================================
#define UV_EnData 10 //UV detect times to delay confirm
#define OV_EnData 10 //OV detect times to delay confirm
#define OC_DSG_EnData 10 //Discharge OC detect times to delay confirm
#define OC_CHG_EnData 10 //Charge OC detect times to delay confirm
#define COT_EnData 10 //Charge OC detect times to delay confirm
#define DOT_EnData 10 //Discharge OC detect times to delay confirm
#define UT_EnData 10 //UT detect times to delay confirm
#define PreCHG_EnData 10 //Pre-Charge detect times to delay confirm
#define AL_EnData 10 //Alert detect times to delay confirm
#define OpenCell_EnData 90 //Cell open detect times to delay confirm
#define OpenCell_Cycle 100 //Cell open detect once in mainLoop times
#define OpenCell_CompCycle 200 //Clear once in mainLoop times when keep cell open
// =============================================================================
// Define operation parameter.
// Set it for the battery-management system requirement.
// =============================================================================
#define ADCCur_Idle 3 //ADC current value offset set for charge and discharge confirm
#define OCTime_4s 255 //OC flag clear and time for resume from OC, 255*8ms = 2s
#define BLANCE_TIME 255 //Set for cell balance time set, 255*8ms = 2s
#define CB_LPMKeepTime 2 //Set keeping time in LPM, 125*32ms = 4s
#define CB_LPMCount 8000 //Set time to go to LPM when idle, 2000 -> 16S
#define LoadCheck_Times 3 //Detect times for load check to confirm
#define OpLoad_Interval 60 //ADC margin set for open load check, 60->0.6 mV
// =============================================================================
// Define coulometer LED display level.
// Set it by cell voltage for reference, it is different from gauge level.
// =============================================================================
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2014, Texas Instruments Incorporated