Other Parts Discussed in Thread: BQ25121A
BQ25120 SYSout voltage return to default value after a few sec of configuration via I2c.
Observation: The SYSout voltage won't drop if we constantly read the system register(0x06) valuevia I2c
Configuration:
We pull up pin NCD pin all time high. Here is our code for register configuration.
/* Common addresses definition for pmic. */ /* BQ25120 power management IC TWI/I2C slaves address */ #define BQ25120_SLAVE_ADDR 0x6A #define BQ25120_BTTN_REG 0x08 #define BQ25120_SYS_REG 0x06 #define BQ25120_LDO_REG 0x07 #define BQ25120_FAST_CHRG_REG 0x03 #define BQ25120_PRECHRG_REG 0x04 #define BQ25120_BATTV_CTRL_REG 0x05 #define BQ25120_ILIM_CTRL_REG 0x09 void pmic_init (void) { ret_code_t err_code; /*BQ25120 register configuration*/ uint8_t bttn_config[2]= {BQ25120_BTTN_REG, 0xFC}; uint8_t sysv_config[2]= {BQ25120_SYS_REG, 0xF8}; uint8_t ldo_config1[2]= {BQ25120_LDO_REG, 0x44}; uint8_t ldo_config2[2]= {BQ25120_LDO_REG, 0xC4}; uint8_t fast_chrg_config[2]= {BQ25120_FAST_CHRG_REG, 0x90}; uint8_t prechrg_config[2]= {BQ25120_PRECHRG_REG, 0x8A}; uint8_t batt_vol_config[2]= {BQ25120_BATTV_CTRL_REG, 0x78}; uint8_t ilim_config[2]= {BQ25120_PRECHRG_REG, 0x22}; /* configure BQ25120 register */ /*Push-button Control Register, 1st wake up event at 600ms, 2nd wakeup event at 1.5s*/ err_code = nrf_drv_twi_tx(&m_twi1, BQ25120_SLAVE_ADDR, bttn_config, sizeof(bttn_config), false); APP_ERROR_CHECK(err_code); /*SYS VOUT control Register, Range 1.8V~3.3V, SYS output at 3V*/ err_code = nrf_drv_twi_tx(&m_twi1, BQ25120_SLAVE_ADDR, sysv_config, sizeof(sysv_config), false); APP_ERROR_CHECK(err_code); /*Load Switch and LDO control Register, Range 1.8V~3.3V, SYS output at 3V*/ err_code = nrf_drv_twi_tx(&m_twi1, BQ25120_SLAVE_ADDR, ldo_config1, sizeof(ldo_config1), false); APP_ERROR_CHECK(err_code); /*Load Switch and LDO control Register, Range 1.8V~3.3V, SYS output at 3V*/ err_code = nrf_drv_twi_tx(&m_twi1, BQ25120_SLAVE_ADDR, ldo_config2, sizeof(ldo_config2), false); APP_ERROR_CHECK(err_code); /*Fast Charging current control Register, Iset pin connects to 2.49kohm resistor for 80mA charging current*/ err_code = nrf_drv_twi_tx(&m_twi1, BQ25120_SLAVE_ADDR, fast_chrg_config, sizeof(fast_chrg_config), false); APP_ERROR_CHECK(err_code); /*Pre-charge current control Register, 10% pre-charge/termination current (8mA)*/ err_code = nrf_drv_twi_tx(&m_twi1, BQ25120_SLAVE_ADDR, prechrg_config, sizeof(prechrg_config), false); APP_ERROR_CHECK(err_code); /*Battery Voltage Control Register, Charging voltage 4.2V (default)*/ err_code = nrf_drv_twi_tx(&m_twi1, BQ25120_SLAVE_ADDR, batt_vol_config, sizeof(batt_vol_config), false); APP_ERROR_CHECK(err_code); /*Input current and voltage protection control Register, Input current 200mA, UVLO 3.0V*/ err_code = nrf_drv_twi_tx(&m_twi1, BQ25120_SLAVE_ADDR, ilim_config, sizeof(ilim_config), false); APP_ERROR_CHECK(err_code); }