NPM1300 usage question

Hello,

I am using the nPM1300 IC on a custom PCB with the nRF5340 + nRF7002 + nPM1300 configuration. sdk v2.8.0

I am trying to read the battery status (ADC value) via TWI, but I am unable to retrieve the battery information.

I have a few questions:

  1. When using the nPM1300, is it necessary to export the configuration from the nPM PowerUP app as an overlay and include it in the project during development?
  2. If so, where should this overlay be placed in VS Code? (Is the part shown in the image correct?) 
  3. Can you check if there are any issues with my DTS and code?

            nrf7002dk_nrf5340_cpuapp.dts

  1. Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (c) 2024 Nordic Semiconductor ASA
    *
    * SPDX-License-Identifier: Apache-2.0
    */
    /dts-v1/;
    #include <nordic/nrf5340_cpuapp_qkaa.dtsi>
    #include "nrf5340_cpuapp_common.dtsi"
    #include "nrf7002dk_nrf5340_cpuapp_pinctrl.dtsi"
    / {
    model = "Nordic NRF7002 DK NRF5340 Application";
    compatible = "nordic,nrf7002-dk-nrf5340-cpuapp";
    chosen {
    zephyr,sram = &sram0_image;
    zephyr,flash = &flash0;
    zephyr,code-partition = &slot0_partition;
    zephyr,sram-secure-partition = &sram0_s;
    zephyr,sram-non-secure-partition = &sram0_ns;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  1. main.c
  2. Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #include <zephyr/logging/log.h>
    LOG_MODULE_REGISTER(Provisioning, CONFIG_LOG_DEFAULT_LEVEL);
    #include <zephyr/kernel.h>
    #include <zephyr/drivers/i2c.h>
    #include "Algo/TCP_Client.h"
    #include "Algo/Provisioning.h"
    #include "Algo/ADC.h"
    #include "Algo/deviceInformation.h"
    // nPM1300 I2C I2C ( DT_NODELABEL )
    #define NPM1300_I2C_ADDR 0x6B
    #define I2C_BUS_NODE DT_NODELABEL(i2c1)
    // ( ; VBAT )
    #define REG_TASKVBATMEASURE 0x00 // VBAT
    #define REG_ADCVBATRESULTMSB 0x11 // VBAT ADC MSB ( 8)
    #define REG_ADCGP0RESULTLSBS 0x15 // 2 (LSB)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Currently, the battery level is not being read.
In this state, when the VBUS (USB charging cable) is connected, no voltage is output.
However, when only the battery is connected, approximately 2.7V is output.