Other Parts Discussed in Thread: BQ25798, BQSTUDIO
Tool/software:
At present, we have applied your company's BQ28Z620 chip to our actual project, working together with the BQ25798 chip. However, we have discovered an issue where our board should have a current of 70-80mA when turned on, but the data we read back with bq28z620 is 0, and our EE colleague's data read back on BQStudio is 80mA
After a period of time, the current is shown in the figure
May I ask what possible reasons may have caused it
The relevant code and data read by the logic analyzer are as follows
#define BQ28Z620_CMD__CURRENT 0x0C static int read_reg(const msdk_device_t *dev, uint8_t reg, uint8_t *value, uint8_t size) { int ret = MSDK_STATUS__ERROR; const bq28z620_cfg_t *const dev_config = (const bq28z620_cfg_t *const)dev->config; ret = msdk_i2c_read_reg(dev_config->i2c_dev, dev_config->i2c_addr, reg, value, size); return ret; } static int read_current(const msdk_device_t *dev, int16_t *milli_ampere) { uint8_t current_data[2] = {0}; int res = MSDK_STATUS__ERROR; res = read_reg(dev, BQ28Z620_CMD__CURRENT, current_data, sizeof(current_data)); if (MSDK_STATUS__OK == res) { uint16_t raw_value = (current_data[0] << 8) | current_data[1]; if(!(raw_value & 0x8000)) { *milli_ampere = (int16_t)raw_value; } else { *milli_ampere = -(int16_t)(raw_value & 0x7FFF); } } return res; } msdk_status_t bq28z620_property_get(const msdk_device_t *dev, msdk_fuel_gauge_property_t prop, msdk_fuel_gauge_propval_t *val) { MSDK_ASSERT(dev != NULL); MSDK_LOG_DBG("bq28z620_property_get: dev 0x%08x, prop %d", dev, prop); int res = MSDK_STATUS__ERROR; switch(prop) { case MSDK_FUEL_GAUGE_PROP_CURRENT: { int16_t mA = 0; res =read_current(dev, &mA); val->current = (int32_t)mA; } break; default: res = MSDK_STATUS__NOT_SUPPORTED; break; } return res; }


Best Regards!
Iris