Marek128b / BQ76942-pcbs-esp32

a repo that contains test PCBs and code for the BQ76942 chip
0 stars 0 forks source link

BQ76942-lib #12

Open Marek128b opened 3 months ago

Marek128b commented 3 months ago

Functional block Diagram

Image

Marek128b commented 3 months ago

Voltage Measurement

Technical Referance Manual BQ76942 @ page 19

The BQ76942 device integrates a voltage ADC that is multiplexed between measurements of cell voltages, an internal temperature sensor, up to nine external thermistors, and also performs measurements of the voltage at the VC10 pin, the PACK pin, the LD pin, the internal Vref used by the coulomb counter, and the VSS rail (for diagnostic purposes). The BQ76942 device supports measurement of individual differential cell voltages in a series configuration, ranging from 3 series cells to 10 series cells. Each cell voltage measurement is a differential measurement of the voltage between two adjacent cell input pins, such as VC1–VC0, VC2–VC1, and so forth. The cell voltage measurements are processed based on trim and calibration corrections, and then reported in 16-bit resolution using units of 1 mV. The raw 24-bit digital output of the ADC is also available for readout using 32-bit subcommands (the 24-bit data is contained in the lower 3 bytes of the 32-bit data, and is sign-extended to create the upper byte). The cell voltage measurements can support a recommended voltage range from –0.2 V to 5.5 V. If a cell voltage is applied that exceeds a level of 5 × VREF1 (approximately 6.06 V), the device may report a value of –6.06 V (and the cell voltage raw counts similarly would report a value of -8388608). For best performance, stay at a maximum input of 5.5 V. The 16-bit cell and VC10 (stack), PACK, and LD pin voltage measurements are available by using the commands listed below. Command Name Unit
0x14 and 0x15 Cell 1 Voltage mV
0x16 and 0x17 Cell 2 Voltage mV
0x18 and 0x19 Cell 3 Voltage mV
0x1A and 0x1B Cell 4 Voltage mV
0x1C and 0x1D Cell 5 Voltage mV
0x1E and 0x1F Cell 6 Voltage mV
0x20 and 0x21 Cell 7 Voltage mV
0x22 and 0x23 Cell 8 Voltage mV
0x24 and 0x25 Cell 9 Voltage mV
0x26 and 0x27 Cell 10 Voltage mV
0x34 and 0x35 Stack (VC10 pin) voltage userV
0x36 and 0x37 PACK pin voltage userV
0x38 and 0x39 LD pin voltage userV

Image

Marek128b commented 2 months ago

Direct commands and sub commands

Technical Referance Manual BQ76942 @ page 13

Marek128b commented 2 months ago

Sub Command Registers

SCL: Sub Command Lower Byte SCU: Sub Command Upper Byte

Marek128b commented 2 months ago

An easier approach that is less efficient on bus traffic is:

  1. Write the lower byte of the subcommand to 0x3E.
  2. Write the upper byte of the subcommand to 0x3F.
  3. Read 0x3E and 0x3F. If this returns 0xFF, this indicates that the subcommand has not completed the operation yet. When the subcommand has completed, the readback returns what was originally written. Continue reading 0x3E and 0x3F until it returns what was written originally. Note: This response only applies to subcommands that return data to be read back.
  4. Read 0x40 to 0x61 in a block. Ensure that the checksum at 0x60 is correct over the length designated by 0x61. This means sometimes more bytes are read than necessary, but it also makes it possible to use a standard function that can be called for all subcommands.
Marek128b commented 2 months ago

4.7 Internal Temperature Measurement

The BQ76942 device integrates the capability to measure its internal die temperature by digitizing an internal transistor base-emitter voltage. This voltage is measured periodically as part of the measurement loop and is processed to provide a temperature value using the 0x68 Int Temperature() command. This internal temperature measurement can be used for cell temperature protections and logic that uses minimum, maximum, or average cell temperature by setting the Settings:Configuration:DA Configuration[TINT_EN] configuration bit and keeping the Settings:Configuration:DA Configuration[TINT_FETT] bit cleared. The internal temperature measurement can instead be used for FET temperature by setting both Settings:Configuration:DA Configuration[TINT_EN] and Settings:Configuration:DA Configuration[TINT_FETT], although in this case it will not be used for cell temperature. The calculation of temperature is performed as follows: Internal Temperature (in units of 0.1 K) = (ADC value) × Calibration:Internal Temp Model:Int Gain / 65536 + Calibration:Internal Temp Model:Int base offset + Calibration:Temperature:Internal Temp Offset except if (ADC value) > Calibration:Internal Temp Model:Int Maximum AD, then the reported internal temperature is calculated using the Calibration:Internal Temp Model:Int Maximum AD as the ADC value. If internal temperature is calculated > Calibration:Internal Temp Model:Int Maximum Temp, the reported internal temperature is set to Calibration:Internal Temp Model:Int Maximum Temp.