2017-06-27 05:35 AM
Hello everyone,
I would like to ask a question about a problem with the integrated STC3115.I apologize first if the question is displayed incorrectly or implicitly.
I've read some examples including the STSW-BAT001, but I find some problem with reading the remaining time of the battery in my application. I see correctly SOC and other information such as ChargeValue and Current, but the remaining time function always returns an error (-1) which is inevitable since RemTime is initially set to zero and Current is always negative when using batteries. At every call i read all the data except the remaining time.
I attach the
STSW-BAT001 example and here the
function mentioned in the Driver.c file:/ * Remaining time calculation * /
If (BatteryData-> Current <0){BatteryData-> RemTime = (BatteryData-> RemTime * 4 + BatteryData-> ChargeValue / BatteryData-> Current * 60) / 5;If (BatteryData-> RemTime <0)BatteryData-> RemTime = -1; / * Means no estimated time available * /}elseBatteryData-> RemTime = -1; / * Means no estimated time available * /}Also I can not understand what the measurement unit would be coming out, since ChargeValue is mAh and Current mA, i expect to get 'hours' units right?
Thanks for your help
#time #stc3115 #error #power #battery-life