Read a register of MAX17260 using TWI

Hi,

I'm working on a custom board with an nRF52840 MCU and a MAX17260 fuel gauge IC interfaced via I2C. The goal is to read the voltage of a battery using the MAX17260. I've verified that my I2C communication is functional, as I'm able to read default values correctly from several registers, such as the DesignCap Register (0x18) which gives output 3000(0xbb8) which is correct as per the datasheet. I attempted to read the  MAX1726X_VCELL_REG register (0x09) value with and without any prior configuration of the fuel guage IC(max17260), but the outcome remains the same. I suspect there’s a specific calculation or conversion process required to interpret the read data correctly, but I’m not sure what that is.

Additional Information:

  • I’ve verified the I2C communication and the register address.
  • I have tried reading the voltage from the MAX1726X_VCELL_REG register (0x09).and applying the formula read_voltage * 0.0078125 (46613*0.000078125 = 3.641), but When I measured the voltage using multimeter across the Vin and GND pin of the battery, it displays 4.02 Volt .this doesn’t match with the read data from the i2c.


    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /** @file
    * @defgroup tw_sensor_example main.c
    * @{
    * @ingroup nrf_twi_example
    * @brief TWI Sensor Example main file.
    *
    * This file contains the source code for a sample application using TWI.
    *
    */
    #include <stdio.h>
    #include <string.h>
    #include "app_error.h"
    #include "app_util_platform.h"
    #include "boards.h"
    #include "nrf_delay.h"
    #include "nrf_drv_twi.h"
    #include "nrf_log.h"
    #include "nrf_log_ctrl.h"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Provide guidance on what might be going wrong? Any suggestions or insights would be greatly appreciated.

Thanks in advance!