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!

Parents Reply Children
  • Hi Sigurd,
    I have followed the initialization and configuration process as per attached document. https://www.analog.com/media/en/technical-documentation/user-guides/modelgauge-m5-host-side-software-implementation-guide.pdf
    I successfully read the design capacity register, which returns 3000 (0xbb8), matching the datasheet and confirming that my I2C read function is working correctly.
    As suggested I have read MAX1726X_AVGVCELL_REG register (0x19) returns 47600(47600 *0.000078125 = 3.718) as well as the MAX1726X_VCELL_REG voltage register (0x09) returns 47596 (47596 *0.000078125 = 3.718).

    Issue:
    Using a multimeter, the voltage across the Vin and GND pins of the battery measures 4.115V, still does not match the data read via I2C. same as previously discussed.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /**
    * Copyright (c) 2015 - 2021, Nordic Semiconductor ASA
    *
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without modification,
    * are permitted provided that the following conditions are met:
    *
    * 1. Redistributions of source code must retain the above copyright notice, this
    * list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form, except as embedded into a Nordic
    * Semiconductor ASA integrated circuit in a product or a software update for
    * such product, must reproduce the above copyright notice, this list of
    * conditions and the following disclaimer in the documentation and/or other
    * materials provided with the distribution.
    *
    * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
    * contributors may be used to endorse or promote products derived from this
    * software without specific prior written permission.
    *
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Could there be any other reason ? Should I look into any other factors that might be affecting the readings?

    Thanks in advance!

  • Hi!

    If you are reading the correct values for the other register, then I don't see why MAX1726X_AVGVCELL_REG should be wrong. Maybe you can check with analog devices support team: https://www.analog.com/en/support.html

  • Thank you for support. 
    I will check with analogue device support team.