MPF42791
2 to 16 Stacked Cells Battery Pack
Fuel Gauge with Resistance Detection
and Thermal Model
DESCRIPTION
FEATURES
The MPF42791 is a drop-in solution to provide
comprehensive status information on lithium-ion
battery strings up to 16 series cells. The
MPF42791 estimates the internal state-ofcharge (SOC) and state-of-health (SOH) for
each cell, as well as the full pack. The
MPF42791 also determines impedance,
remaining
runtime,
charge
time,
and
instantaneous available power. On-board
memory enables the lifetime logging of key
parameters.
•
The MPF42791 is simple to use and supports a
variety of lithium cell chemistries and cell sizes.
A few basic configurations allow for quick set-up,
and advanced configuration capabilities can
fine-tune the device for specific applications.
When paired with an MP279x battery monitor,
the MPF42791 can achieve SOC accuracy
within 2.5% across the temperature range. The
MPF42791 can also be paired with other analog
front-end (AFE) or battery stack monitors. The
400kHz I2C interface provides standard, robust
communication. The 5-level LED drivers provide
a simple, cost-effective charge level indicator for
the device.
The MPF42791 is available in a TQFN-32
(4mmx4mm) package.
MINIMUM SYSTEM REQUIREMENTS
•
•
BMS AFE Providing Individual Cell
Voltages, Pack Currents, and Temperatures
M0 System MCU with I2C and Interrupt,
48KB of Flash and 4KB of RAM
•
•
•
•
•
•
•
•
•
•
Compatible with Commonly Used Battery
Monitors for Up to 16 Series Cells
o ±2.5% State-of-Charge (SOC) Accuracy
when Paired with MP279x Battery
Monitors
Provides Critical Battery Information:
o Pack and Cell SOC
o Pack and Cell State-of-Health (SOH)
o Remaining Runtime and Charge Time
o Instantaneous Available Power
Supports a Wide Variety of Lithium Cells
Adaptive Learning Can Be Enabled to:
o Refine Initial Charge Settings
o Refine Initial Discharge Settings
o Update Individual Cells’ State-of-Health
(SOH) to Track Degradation
o Update Equivalent Series Resistance
(ESR) to Track Degradation
Provides Lifetime Logging
Supports 5-Level LED SOC Indicator with
Push-Button Trigger
2.5V Minimum Supply Voltage
Low Current Consumption: 6µA in Disabled
Mode and 135µA (Average) in Operating
Mode during Rest
Supports Up to 400kHz I2C with CRC for
Robust Communication
Available in a Compact TQFN-32
(4mmx4mm) Package
Available in Turn-Key MPS BMS Module:
o MBM1xS-P50-B and MBM1xS-P100-B
APPLICATIONS
•
•
•
•
Light EVs: Scooters, Bikes, and Golf Carts
Energy Storage: Uninterruptable Power
Supplies (UPS) and Renewable Energy
Industrial Robots, Floor Cleaners, and
Forklifts
Cordless Tools and Gardening Equipment
All MPS parts are lead-free, halogen-free, and adhere to the RoHS directive.
For MPS green status, please visit the MPS website under Quality
Assurance. “MPS”, the MPS logo, and “Simple, Easy Solutions” are
trademarks of Monolithic Power Systems, Inc. or its subsidiaries.
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
1
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
TYPICAL APPLICATION
I2C
MP279x
SCL
SDA
MPF42791
MCU
CE
3.3V
IRQ
VDD
nRST
VCC
3.3V
Figure 1: MPF42791 with MP279x AFE Typical Electrical Diagram
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
2
MPF42791 – 2 TO 16 STACKED CELL BATTERY PACK FUEL GAUGE W/ LEVEL LEDS
ORDERING INFORMATION
Part Number*
MPF42791DRT-0B-yyyy**
EVKT_MPF42791
EVKT-MBM16S-P50-B
Package
TQFN-32 (4mmx4mm)
Evaluation kit
Evaluation kit
Top Marking
See Below
-
MSL Rating
3
-
* For Tape & Reel, add suffix -Z (e.g. MPF42791DRT-0B-yyyy-Z).
** “-yyyy” refers to the default configuration identifier (“-0000” by default), where each “y” is a hexadecimal value
between 0 and F. Work with an MPS FAE to obtain a customized default configuration.
TOP MARKING
MPF4279X Family generic version
MPS: MPS prefix
Y: Year code
WW: Week code
M4279X: Family part number*
LLLLLL: Lot number
* The specific part number is in the IC_VER register.
EVALUATION KITS EVKT-MBM1XS-P50-B (MP279X BMS)
EVKT-MBM16S-P50-B
EVKT-MBM16S-P50-B kit contents (items below can be ordered separately):
#
Part Number
1
MBM16S-P50-B
2
3
EVKT-USB_RS232/I2C-01
Online resources
Item
MPF42791DRT-0B-0001 and MP2797DFP-0001 reference
design and evaluation board
USB to RS232 / I2C adapter
Include datasheet, user guide, product brief, and GUI
Quantity
1
1
1
EVKT-MBM14S-P50-B
EVKT-MBM14S-P50-B kit contents (items below can be ordered separately):
#
Part Number
1
MBM14S-P50-B
2
3
EVKT-USB_RS232/I2C-01
Online resources
Item
MPF42791DRT-0B-0001 and MP2791DFP-0001 reference
design and evaluation board
USB to RS232 / I2C adapter
Include datasheet, user guide, product brief, and GUI
Quantity
1
1
1
Order directly from MonolithicPower.com or our distributors.
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
3
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
Figure 2: MBM1xS-P50-B Evaluation Kit Set-Up
PACKAGE REFERENCE
25 IRQ
26 NC
28 CHSL
27 NC
30 SDAMON
29 SCLMON
32 GND
31 VCC
TOP VIEW
PB
1
24 SDA
LED1
2
23 SCL
LED2
3
22 NC
LED3
4
LED4
5
LED5
6
19 NC
N/C
7
18 NC
N/C
8
17 NC
21 NC
NC 16
CE 15
NC 13
20 NC
NC 14
GND 11
nRST 12
9
LDO
VDD 10
GND
33
Pin 33 (GND) is an exposed pad that requires a GND
connection
TQFN-32 (4mmx4mm)
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
4
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
PIN FUNCTIONS
Pin #
Name
I/O
Description
1
2
3
4
5
6
7
8
PB
LED1
LED2
LED3
LED4
LED5
NC
NC
I
O
O
O
O
O
-
9
LDO
Power
10
VDD
Power
11
12
13
14
GND
nRST
NC
NC
Power
I
-
15
CE
I
16
17
18
19
20
21
22
23
24
25
26
27
NC
NC
NC
NC
NC
NC
NC
SCL
SDA
IRQ
NC
NC
I/O
I/O
O
-
28
CHSL
I
29
SCLMON
I/O
30
SDAMON
I/O
31
VCC
Power
32
33
GND
GND
Power
Power
Push-button. Triggers state-of-charge (SOC) LED indicator.
LED 1 driver. The LED1 pin reports the SOC with a 330Ω resistor in series.
LED 2 driver. The LED2 pin reports the SOC with a 330Ω resistor in series.
LED 3 driver. The LED3 pin reports the SOC with a 330Ω resistor in series.
LED 4 driver. The LED4 pin reports the SOC with a 330Ω resistor in series.
LED 5 driver. The LED5 pin reports the SOC with a 330Ω resistor in series.
No connection.
No connection.
Internal LDO. Bypass the LDO pin with a 2.2μF + 100nF ceramic capacitor
connected to ground.
Power supply input. Bypass VDD with a 2.2μF ceramic capacitor connected to
ground.
Ground pin.
IC reset control.
No connection.
No connection.
Chip enabled. Set the CE pin to stop fuel gauge updates and disable the
communication interface to minimize current consumption.
No connection.
No connection.
No connection.
No connection.
No connection.
No connection.
No connection.
I2C interface clock. Connect the SCL pin to the logic rail through a 10kΩ resistor.
I2C interface data. Connect the SDA pin to the logic rail through a 10kΩ resistor.
Interrupt request pin. The IRQ pin is the interrupt going to the host system(s).
No connection.
No connection.
Channel selection. The CHSL pin selects which I2C channel is capable of writing
data into the fuel gauge memory. Pull CHSL high to write data using the secondary
I2C.
Secondary I2C interface clock. Connect the SCLMON pin to the logic rail through
a 10kΩ resistor.
Secondary I2C interface data. Connect the SDAMON pin to the logic rail through a
10kΩ resistor.
3V to 3.3V power supply input. Bypass the VCC pin with a 2.2µF ceramic capacitor
connected to ground.
Ground pin.
Ground pin.
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
5
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
θJA
θJC
ABSOLUTE MAXIMUM RATINGS (1)
Thermal Resistance (4)
VCC supply voltage (VCC) ........................... 3.6V
VDD supply voltage (VDD) ........................... 3.6V
nRST pin......................................-0.3V to +3.6V
All other pins ........................ -0.3V to VCC + 0.3V
Total power dissipation (TA = 25°C) (2)
…………………………………………….. 500mW
Storage temperature ................ -55°C to +150°C
Junction temperature ............... -55°C to +150°C
TQFN-32 (4mmx4mm)...........47…...4.5…°C/W
ESD Ratings
Human body model (HBM) .................... ±4000V
Recommended Operating Conditions (3)
Supply voltage (VDD) .......................... 3V to 3.6V
All other pins ........................ -0.3V to VCC + 0.3V
Operating junction temp (TJ) ...... -40°C to +85°C
Notes:
1) Exceeding these ratings may damage the device.
2) The maximum allowable power dissipation is a function of the
maximum junction temperature, TJ (MAX), the junction-toambient thermal resistance, θJA, and the ambient temperature,
TA. The maximum allowable continuous power dissipation at
any ambient temperature is calculated by PD (MAX) = (TJ
(MAX) - TA) / θJA. Exceeding the maximum allowable power
dissipation can produce an excessive die temperature, and the
regulator may go into thermal shutdown. Internal thermal
shutdown circuitry protects the device from permanent
damage.
3) The device is not guaranteed to function outside of its operating
conditions.
4) Measured on JESD51-7, 4-layer PCB.
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
6
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
ELECTRICAL CHARACTERISTICS
VCC = 3.3V, TA = 25°C, unless otherwise noted.
Parameters
Symbol Condition
Min
Typ
Max
Units
State-of-Charge (SOC) Performance
MPS MP279x AFE family,
15°C ≤ TA ≤ 35°C, ICHG ≤ 0.5C,
-2
0
+2
%
IDIS ≤ 0.5C
MPS MP279x AFE family,
Pack state-of-charge (SOC)
θERR
10°C ≤ TA ≤ 50°C, ICHG ≤ 1C,
-3
0
+3
%
(5)
accuracy
IDIS ≤ 1C
MPS MP279x AFE family,
10°C ≤ TA ≤ 50°C, ICHG ≤ 2C,
-4
0
+4
%
IDIS ≤ 2C
Power Supply
VDD operating voltage range
VDD
2.5
3.3
3.6
V
VCC operating voltage range
VCC
2.5
3.3
3.6
V
VDD = 3.3V, LEDs off, fuel
Total active current
IDD_ACTIVE
4.3
mA
gauge updating
IDD_
VDD = 3.3V, LEDs off, fuel
Total standby current
50
μA
gauge idle
STANDBY
VDD = 3.3V, LEDs off,
Average operating current
IDD_
EXE_TIME = 4s,
476
μA
during CHG or DSG
NCELLS_SER = 10, with I2C
CHG/DSG
traffic
VDD = 3.3V, LEDs off,
NCELLS_SER = 10,
Average operating current
IDD_REST EXE_TIME = 4s,
192
μA
during rest
WEXE_TIME_REST = 4, with
I2C traffic
Total disabled current
IDD_DIS VDD = 3.3V
6
μA
Power-On Reset (POR)
Release threshold of POR
VROT
VDD rising
1.66
1.79
1.9
V
nRST Pin
nRST pin threshold voltage
VRST
0.2 x VDD
0.9 x VDD
V
Minimum pulse width on
tRST
VDD = 3.3V
700
ns
nRST pin
Timeout after reset
tTOUT
64
128
ms
CE
Low input voltage
VOL_CE IOL = 5mA
-0.3
0.35 x VDD
V
High input voltage
VOH_CE
0.65 x VDD
0.3V + VDD
V
I
CE_LKG_
Low leakage current
VCE = 3.3V
3
μA
LOW
High leakage current
IRQ
Low output voltage
High output voltage
PB
Low input voltage
High input voltage
CHSL
Low input voltage
High input voltage
ICE_LKG_
HIGH
VIRQL
VIRQH
VCE = 3.3V
Sink = 4mA
Source = 4mA
3
μA
0.4
V
V
VDD - 0.4
VPBL
VPBH
-0.3
0.65 x VDD
0.35 x VDD
0.3V + VDD
V
V
VPBL
VPBH
-0.3
0.65 x VDD
0.35 x VDD
0.3V + VDD
V
V
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
7
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
ELECTRICAL CHARACTERISTICS (continued)
VDD = 3.3V, TA = 25°C, unless otherwise noted.
Parameters
LEDs
Symbol
Condition
High-level output voltage
VOH_LED
Output current = 4 mA
High-level output current
I2C DC Characteristics
IOH_LED
VLEDx = VDD - 0.4V
Min
Typ
Max
VDD 0.4V
4
High input voltage
VIH
SCL, SDA
0.7 x
VDD
Low input voltage
VIL
SCL, SDA
-0.5
Low output voltage
I2C Timing Characteristics
Spikes suppressed by input filter
Operating frequency range
SCL clock low period
SCL clock high period
SCL and SDA falling time
SCL and SDA rising time
Data hold time
Data set-up time
Data valid time
Set-up time for a repeated start
condition
Hold time for a repeated start
condition
Set-up time for a stop condition
VOL
SDA, sink current = 3mA
0
Units
V
mA
0.3V +
VDD
0.3 x
VDD
0.4
50
400
V
V
V
tSP
fSCL
tLOW
tHIGH
tFALL
tRISE
1.125
1.125
tHD_DAT
tSU_DAT
tV_DAT
0
125
475
ns
kHz
μs
μs
μs
μs
ns
ns
ns
tSU_STA
125
ns
tHD_STA
0
ns
tSU_STO
125
ns
0.34
0.34
Note:
5) Validated on a 10S1P Samsung INR18650 25R pack (see the Typical Performance Characteristics section on page 9 for more details).
Similar results can be achieved with other cell/pack types after characterization.
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
8
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
TYPICAL PERFORMANCE CHARACTERISTICS
The MPF42791 fuel gauge performance depends on multiple factors, such as the accuracy of the
measurements, the correctness of the configuration, and the fidelity of the cell mathematical model. This
means that fuel gauge performance may vary depending on the battery operating conditions.
This section shows examples of the MPS MPF42791 fuel gauge pack’s SOC performance when paired
with MPS’s MP279x AFE family.
Constant-Current/Constant-Voltage (CC/CV) Charge and Dynamic Discharge Cycle
The next scenarios consist of charging a 10S1P (6) battery using the typical CC/CV method, followed by
a highly dynamic discharge at different ambient temperatures. The charge constant current rate is 1C,
while the charge termination current in this example is 0.1C. The highly dynamic discharge corresponds
to a typical e-bike’s current profile, with an average current of 1C and maximum peak currents up to 2.8C.
Figure 3 shows the current profile of the complete cycle at 25°C.
1
Current C-Rate
0.5
0
-0.5
-1
-1.5
-2
-2.5
-3
0
20
40
0
0
100
120
140
1 0
Time min
Figure 3: CC/CV Charge and Dynamic Discharge Current Profile
Figure 4 shows the MPF42791’s performance for the CC/CV charge and dynamic discharge cycle at an
ambient temperature of 25°C. During charge, the root-mean-squared (7) and maximum pack SOC error
are 0.61% and 1.03%, respectively. During discharge, the root-mean-squared and pack SOC error are
0.78% and 1.94%, respectively.
Notes:
6) 10S1P refers to the battery configuration. There are 10 groups of 1 parallel cell connected in series.
̂ 2
∑𝑁
𝑛=1(𝜃𝑛 −𝜃𝑛 )
𝑁
, where θ is the actual SOC, 𝜃̂ is the estimated SOC, and N is the number of samples.
100
10
MPF42791
Reference
Error
0
State-Of-Charge
3
5
SOC Error ound
0
0
40
-3
SOC Error ound
-5
20
0
0
20
40
0
0
100
120
140
State-Of-Charge Error
7) The RMS error is equal to √
-10
1 0
Time min
Figure 4: MPF42791 Performance for a CC/CV Charge and Dynamic Discharge (Ambient Temperature =
25°C)
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
9
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
Figure 5 shows the MPF42791’s performance for the CC/CV charge and dynamic discharge cycle at an
ambient temperature of 0°C. During charge, the root-mean-squared and maximum pack SOC error are
0.68% and 1.22%, respectively. During discharge, the root-mean-squared and pack SOC error are 1.15%
and 2.97%, respectively.
100
10
MPF42791
Reference
Error
State-Of-Charge
3
5
SOC Error ound
State-Of-Charge Error
0
0
0
40
-3
SOC Error ound
-5
20
0
0
50
100
-10
150
Time min
Figure 5: MPF42791 Performance for a CC/CV Charge and Dynamic Discharge (Ambient Temperature = 0°C)
Figure 6 shows the MPF42791’s performance for the CC/CV charge and dynamic discharge cycle at
40°C ambient temperature. During charge, the root-mean-squared and maximum pack SOC error are
0.40% and 0.60%, respectively. During discharge, the root-mean-squared and pack SOC error are 0.77%
and 1.89%, respectively.
100
10
0
State-Of-Charge
3
5
SOC Error ound
0
0
40
-3
SOC Error ound
-5
20
0
0
50
100
150
State-Of-Charge Error
MPF42791
Reference
Error
-10
Time min
Figure 6: MPF42791 Performance for a CC/CV Charge and Dynamic Discharge (Ambient Temperature =
40°C)
Performance Summary
This section provides a summary of the MPF42791’s real-world performance. Table 2Error! Reference
source not found. shows a summary of the pack SOC performance metrics for a 10S1P battery.
Table 2: MPF42791 SOC Root-Mean-Squared (and Maximum) Error
Test Case
CC/CV charge
Dynamic discharge
0°C
0.68% (1.22%)
1.15% (2.97%)
25°C
0.61% (1.03%)
0.78% (1.94%)
40°C
0.40% (0.60%)
0.77% (1.89%)
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
10
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
OPERATION
The MPF42791 relies on a host microcontroller
(MCU) to periodically update the fuel gauge’s
required inputs. This includes the cell voltages
(via the VRDG_CELLxx registers), current (via
the IRDG_CELLxx registers), and temperature
(via the TRDG_TSx registers).
The host MCU is responsible for synchronizing
the input data to the fuel gauge’s execution time
(EXE_TIME). The host MCU sends the
EXE_CMD command to trigger the fuel gauge
execution and waits until the iteration is
completed (FG_EXE_FLAG = 0). Then the host
MCU can read back the fuel gauge’s output
registers, such as the pack state-of-charge
(SOC). The interrupt request (IRQ) pin can be
configured to notify several events, such as a
completed iteration or other conditions (see the
xx_INTR_EN registers starting on page 56 for
details).
Operating Modes
Active
In active mode, the fuel gauge is either updating
the battery internal states or communicating via
the I2C bus.
Standby
In standby mode, the fuel gauge is idle, which
means that all triggered updates have been
completed and the fuel gauge is waiting for
activity on the SDA line to transition to active
mode. See the I2C Communication Interface
section on page 12 for more details.
Disabled
In disabled mode, the chip enable (CE) pin is
low. I2C communication is not available, and the
fuel
gauge
achieves
minimal
current
consumption but still retains all internal state
variables in its memory.
Configuration and Data Exchange
Configuration Mode
In the configuration mode, the MPF42791 is set
to receive configuration parameters. However,
the device will stop operating. This mode is
enabled by sending the CONFIG_MODE_CMD
and can be confirmed by reading the
CONFIG_MODE_FLAG register. After the fuel
gauge configurations are successfully updated,
the host system must send the
CONFIG_EXIT_CMD command to save the
configuration into non-volatile memory (NVM).
This ensures that the configuration remains after
a hardware reset (cycling the device’s power or
cycling power on the nRST pin).
Editing Mode
As an alternative to the configuration mode, the
edit mode allows for partial configuration
changes. In this mode, the fuel gauge settings
can be updated, but not changes to the fuel
gauge cell model. Configuration mode is
required to change the fuel gauge cell model.
In this mode, the fuel gauge operation does not
stop, which allows for on-the-fly configurations.
This mode is enabled by sending the
EDIT_CONFIG_CMD command and can be
confirmed
by
reading
the
EDIT_SETTINGS_FLAG. The host system can
exit
this
mode
by
sending
the
END_EDIT_CONFIG_CMD
or
CONFIG_EXIT_CMD command, which store the
updated configuration in the MPF42791’s NVM.
LED Control
The MPF42791 can drive five external LEDs that
report the pack SOC. There are 2 methods for
controlling the LEDs, direct control or manual
control, which is configured using the
LEDS_ON_MAN register.
Note that the LED settings can be written at any
time during active or standby operating modes
without having to enter configuration or edit
modes.
Direct Control
With direct LED control, the fuel gauge directly
controls the LEDs based on the pack SOC (see
Table 1 on page 12). When the PB pin is pulled
low (if the LEDS_ON_BTN register is enabled),
or when the battery pack is charging (if
LEDS_ON_CHG is enabled), the LEDs display
pack SOC. The deglitch time between charge
and discharge can be configured via the
LED_TRANS register. The LED turn-on time can
be configured via the LEDS_ON_TIME register.
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
11
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
Table 1: LED State-of-Charge Indicator Map
LED Status
Pack SOC
1
2
4
4
5
SOC > 90%
On On On On On
90% ≥ SOC >
On On On On Off
70%
70% ≥ SOC >
On On On Off Off
50%
50% ≥ SOC >
On On Off Off Off
30%
30% ≥ SOC >
On Off Off Off Off
10%
10% ≥ SOC
Off Off Off Off Off
Manual LED Control
With manual LED control, the host manually
controls each LED via the corresponding
LEDx_ON register.
I2C COMMUNICATION INTERFACE
The MPF42791 has two I2C-compatible
interfaces.
The
primary
I2C
channel
communicates with the host MCU which
extracts the data from the AFE. The secondary
I2C channel is designed to monitor the fuel
gauge status in real time and configure the fuel
gauge using the MPF4279x graphic user
interface (GUI). Note that write operations are
only accepted from one channel at a time (the
primary channel by default). To write to the fuel
gauge using the secondary I2C channel, the
CHSL pin must be pulled high; otherwise, write
operations from this channel are ignored.
I2C
The
is a bidirectional, two-wire serial
interface. Only two bus lines are required: a
serial data line (SDA) and a serial clock line
(SCL). The device can be considered a master
or a slave when performing data transfers. A
device that initiates a data transfer on the bus
and generates the clock signals to permit the
transfer is considered a master. Any device that
the master addresses is considered a slave.
Both MPF42791 I2C interfaces operate as slave
devices with a configurable address (0x08 by
default). They receive control inputs from the
master device and ignore general call
addresses.
The I2C interface supports both standard mode
(up to 100kbits), and fast mode (up to 400kbits).
The SDA and SCL lines are bidirectional with
open drain outputs that should be connected to
the positive supply voltage via a current source
or pull-up resistor. When the bus is free, both
lines are high.
The data on the SDA line must be stable during
the high period of the clock. the high or low state
of the data line can only change when the clock
signal on the SCL line is low. Note that a single
clock pulse is generated for each data bit
transferred (see Figure 7).
Figure 7: Bit Transfer on the I2C Bus
All transactions must begin with a start (S)
command and can be terminated with a stop (P)
command. Start and stop commands are always
generated by the master. A start command is
defined by a high-to-low transition on the SDA
line while SCL is high (see Figure 8). A stop
command is defined by a low-to-high transition
on the SDA line while the SCL is high (see
Figure 8). The bus is considered busy after a
start command and free after a stop command.
Figure 8: I2C Start (S) and Stop (P) Commands
Every byte on the SDA line must be 8 bits long
and must be followed by an acknowledge bit
(ACK). Note that data is transferred with the
most significant bit (MSB) first.
A slave cannot receive or transmit a complete
byte of data while performing other tasks, but it
can hold the SCL line low to force the master into
a wait state (clock stretching). Then, when the
slave is ready, data transfer continues, and the
clock line (SCL) is released. Figure 9 shows a
complete data transfer.
The acknowledgement takes place after every
byte and allows the receiver to signal to the
transmitter that the byte was successfully
received. All clock pulses are generated by the
master, including the 9th clock pulse (ACK).
The transmitter releases the SDA line during the
ACK clock pulse so that the receiver pulls the
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
12
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
SDA line low. If the SDA line remains high during
the acknowledge clock pulse, it is not
acknowledged (NACK). Then the master can
generate a stop command to abort the transfer,
or it can generate a repeated start (Sr) command
to start a new transfer.
After the start command, a 7-bit slave address is
sent, followed by the read/write (R/W) bit. A 0
represents a write transmission (W), while a 1
indicates a read request (R). Figure 9 shows a
complete data transfer.
Figure 9: Complete Data Transfer
Active Mode
The MPF42791 must be in active mode to
communicate (see Operating Modes for
additional detail). To transition to active mode,
the SDA line must be pulled low. There is a 20ms
timeout before starting operation, or the device
transitions back to standby mode. After the
operations
are
completed
(e.g.
I2C
communication or fuel gauge updates) there is a
5ms timeout.
A low 5ms pulse on the SDA line is
recommended to transition to active mode. Note
that it may take a few additional milliseconds for
the MPF42791 to reach active mode and for the
I2C to be ready. To verify that the MPF42791 is
ready for communication, an I2C header with the
start command, the device address, and the R/W
bit can be sent. The device responds with an
ACK signal if it is ready for communication.
Protocol Layer
The MPF42791 uses a protocol where 2 bytes
are used for the register and command
addresses. A length field is also provided to
declare the number of bytes in each read or write
transaction. The maximum allowed transaction
length is 82 bytes of data (not including the
register address, length byte, or CRC bytes).
A Cyclic Redundancy Check (CRC) can be used
to ensure the transaction’s integrity. When
enabled, the last 4 bytes of the transaction
correspond to the CRC. Figure 10 and Figure 11
show an example of read and write transactions
with CRC, respectively.
Figure 10: I2C Read Transaction with CRC
Figure 11: I2C Write Transaction with CRC
If CRC is disabled, a write transaction can
optionally include the correct CRC bytes to be
accepted. During a read, the MPF42791 does
not include the CRC, so the NACK signal and
stop command from the master come after
DATA[x].
I2C operations using any address outside of the
register map are invalid, even if they are partially
valid addresses. An invalid read operation
returns a 0 as the data and correct CRC (if
enabled), and an invalid write operation is
ignored.
Cyclic Redundancy Check (CRC)
The CRC spans the register address, length, and
data payload. It is generated in blocks of 4 bytes.
If the number of bytes is not a multiple of 4, the
MPF42791 Rev. 1.0
MonolithicPower.com
9/19/2022
MPS Proprietary Information. Patent Protected. Unauthorized Photocopy and Duplication Prohibited.
© 2022 MPS. All Rights Reserved.
13
MPF42791 – 2 TO 16 BATTERY PACK FG W/ R DETECTION AND THERMAL MODEL
block is padded with 0x00. The algorithm to
generate the CRC is listed below.
unsigned long crc32 (unsigned short Reg_Address, unsigned
char len, unsigned char *data){
short i;
unsigned long crc = 0xffffffff;
unsigned char dataTemp[4];
To disable CRC and configure the slave address
as 0x08, send the following message: {0x00,
0x41, 0x01, 0x08, 0x94, 0xA0, 0xDE, 0xDD}
(Address = 0x4100, Length = 0x01, Data = 0x08,
CRC = 0xDDDE A094).
for (i=-1; i>8;
dataTemp[3]=0;
}
else dataTemp[i%4]=data[i];
if((i%4)==3 || i == len-1 || i == -1) {
for (char j=0; j