Close

Discussion

A project log for Monitoring Battery Quality and reduce waste

Handheld Readout Device(HRD) for Battery Management Systems. Measure rechargeable batteries.

peter-losPeter Loës 10/11/2021 at 07:350 Comments

Probe for different Controller Types

g_BatteryCtrlAddr: 0x00 - 0xFF

This routine probes the type of battery controller.  This is done by checking
dedicated I2C-bus addresses on the SMBus.  The following addresses and their
corresponding controller type are supported:
- 0x0A in case of Atmel, and
- 0x16 for the TI bq40z50.

Abstract SBS_Commands for different Manufacturer Registers

SBS_DesignCapacity,           //!< 0x18 Word: in [mAh / 10mWh]

SBS_DesignVoltage,             //!< 0x19 Word: in [mV]
SBS_SpecificationInfo,         //!< 0x1A Word: Version and Revision
SBS_ManufactureDate,        //!< 0x1B Word: [Year-1980:7|Month:4|Day:5]

Expansion of item data

This routine returns a formatted data string of the specified item data.
It uses BatteryRegReadWord() and BatteryRegReadBlock() to read the data
directly from the battery controller.

case FRMT_MILLIAMP:    // Current in [±mA], +:charging, -:discharging
        sprintf (strBuf, "%5dmA", (int16_t)data);
        break;

https://github.com/peterloes/HRD/blob/master/Software/drivers/Display.c

Discussions