Tool/software:
Hello,
I have programmed the fuel gauge in SOH mode. It was working perfectly, giving voltage, temperature, design capacity and SOH upon request by their corresponding commands. However, for some reason I don't know it started to give a very low value of SOH while the voltage was 2.7 V (I am using a CR2450) every time I ran it until now that for every battery I obtain 0 %. I tried to fix it by resetting the fuel gauge with 0x0041 and put it in SEALED mode after the configuration (so the CONTROL_STATUS register goes from 0x4081 to 0x6081). Debugging is not giving any result because the other 3 parameters are giving a correct value. I have tried putting Operation Config A in both 0x85 and 0xA5 and I get the same. I haven't performed calibration because it was working without it.
So what's going on with my fuel gauge to stop working correctly?
The function where I read all parameters is this in C:
void gau_readings_get(uint16_t u16_voltage, uint8_t u8_SOH, uint16_t u16_temperature, uint16_t u16_capacity)
{
u16_voltage = gau_volt_read();
u16_temperature = gau_temp_read();
u16_capacity = gau_cap_read();
u8_SOH = gau_SOH_read();
SYSTICK_DelayMs(1000);
}
And the function gau_SOH_read() is this one:
static uint8_t gau_SOH_read(void)
{
/*Reading variables*/
uint8_t u8_SOH[1];
GAUGE_EN_Clear();
SYSTICK_DelayMs(10);
GAUGE_EN_Set();
SYSTICK_DelayMs(1000);
SERCOM4_I2C_WriteRead((uint16_t) u8SlaveAddr,
u8SOHAddr, (uint32_t) 1,
&u8_SOH[0], (uint32_t) 1);
while(SERCOM4_I2C_IsBusy());
return u8_SOH[0];
}
Thanks in advance.
Carlos