2021-05-27 04:57 AM
2021-05-30 11:43 PM
2021-06-02 01:50 AM
Thank you for the reply...i checked with both of your points..It has been correctly soldered...and VMODE has been set to 0..still not able to read the current value...what can be the issue?
2021-06-04 07:51 AM
The sense resistor must be placed between the battery minus pin and the application ground.
Could you please check if the sense resistor impedance is selected correctly accordingly the application need.
The sense resistor impedance depends on the application maximum current and the STC3115 Vin_gg input voltage range:
Vin_gg = Rcg x IMax
Where Rcg = sense resistor value in mΩ and IMax = application peak current in A
Vin_gg must be within the range 40 mV to -40 mV (below 40 mV for IMax charging and above -40 mV for IMax discharging)
2021-06-07 09:14 AM
Actually I am able to read the current value now....But not getting the SOC %....I am using the library provided by ST...What can be the issue?
2021-06-07 06:23 PM
Good to know current sensing works for you now.
Do you mind sharing how you fixed the issue to help the others as well ?
For the SOC, please refer to AN4324: STC3115 system integration and doubly check your configurations.
2021-06-08 12:32 AM
After making below changes im getting current values,but still even after going through AN4324: STC3115 system integration i am not getting the soc value...can i get help regarding this?
We are facing below issues
1> Not getting(get zero values for all) Voltage, Current and Battery State of Charge(battery percentage) with ST's library. Please refer below code.
status = GasGauge_Initialization(&STC3115_ConfigData, &STC3115_BatteryData);
status = GasGauge_Task(&STC3115_ConfigData, &STC3115_BatteryData); /* process gas gauge algorithm, returns results */
if (status > 0) //OK, new data available
{
sprintf(cbuf,"Vbat=%d mV I=%d mA Batt SoC=%d\r\n",STC3115_BatteryData.Voltage,STC3115_BatteryData.Current,(STC3115_BatteryData.SOC * 0.1));
addToDebugQ(cbuf, 1);
printDebugQ();
}
2> With some changes(Additional code) in code of library we are getting Voltage and Current but not Battery percentage. Please refer below code
status = GasGauge_Initialization(&STC3115_ConfigData, &STC3115_BatteryData);
/*************Additional code******************/
cbuf[0]=0x00;
cbuf[1]=0x10;
I2C_Write(2, STC3115_REG_MODE , &cbuf);
/*******************************/
status = GasGauge_Task(&STC3115_ConfigData, &STC3115_BatteryData); /* process gas gauge algorithm, returns results */
if (status > 0) //OK, new data available
{
sprintf(cbuf,"Vbat=%d mV I=%d mA Batt SoC=%d\r\n",STC3115_BatteryData.Voltage,STC3115_BatteryData.Current,(STC3115_BatteryData.SOC * 0.1));
addToDebugQ(cbuf, 1);
printDebugQ();
}
Note: Writing 1 byte with I2C_Write in additional code doesn't work it has to be 2 bytes write operation with I2C_Write
2021-06-10 07:00 AM
For the added code:
cbuf[0]=0x00;
cbuf[1]=0x10;
I2C_Write(2, STC3115_REG_MODE , &cbuf);
Setting Mode Register (offset 0) to 0 means to set VMODE = 0, which is exactly step to set STC315 to mixed mode.
But setting Control and Status Register (offset 1) to 0x10 means to perform software reset, which shall only be used when there is a abnormal situation.
Could you read the status before resetting it, to check what was going on ?