AnsweredAssumed Answered

STC3115: Does not start up

Question asked by meuleman.gijs on Sep 28, 2016
Latest reply on Dec 8, 2017 by gregory.gosciniak
Hello,

We are using a STC3115 in one of our designs. The problem is that it does not start up.


It looks like the problem is that the BATD is 'high'. I tried to force it low by connecting it to ground through a 1K resistor. However, the output of BATD is still 3.7V. Is there a way I can force it to become 'low'?

On the software side:
- I can communicate via I2C. The counter value reads: 1. So it seems that it starts, but then stops.
- A soft reset does not help
- I call BatterMonitorInit once BatteryReadStateOfCharge is called every 500 ms.
- This results in the following output:

My question is, why does it not start? Is there something else i need to initialise?


Code 

void BatteryMonitorInit(TI2CWriteReadFunction I2CWriteReadFunction)
{
    I2CWriteRead = I2CWriteReadFunction;

    TxBuffer[0] = 1; //regctrl
    TxBuffer[1] = 0; //reset
    I2CWriteRead(TxBuffer, 2, RxBuffer, 0);
    // nrf_delay_ms(10);

    //write REG_CC_CNF
    TxBuffer[0] = REG_CC_CNF;
    TxBuffer[1] = 210; //466
    TxBuffer[2] = 1;
    I2CWriteRead(TxBuffer, 3, RxBuffer, 0);

    //write REG_VM_CNF
    TxBuffer[0] = REG_VM_CNF;
    TxBuffer[1] = 157; //157
    TxBuffer[2] = 0;
    I2CWriteRead(TxBuffer, 3, RxBuffer, 0);    

    TxBuffer[0] = REG_MODE;
    TxBuffer[1] = 1+16;
    I2CWriteRead(TxBuffer, 2, RxBuffer, 0);
}

uint8_t BatteryMonitorReadStateOfCharge(void)
{
    TxBuffer[0] = REG_SOC;
    I2CWriteRead(TxBuffer, 1, RxBuffer, 2);
    uint16_t StateOfCharge = (RxBuffer[1] << 8) + RxBuffer[0];
    dbg("rx[1]:%d\n",RxBuffer[1]);
    dbg("rx[0]:%d\n",RxBuffer[0]);
    uint8_t StateOfChargePercentage = StateOfCharge >> 9;

    TxBuffer[0] = 1; //regctrl
    I2CWriteRead(TxBuffer, 1, RxBuffer, 1);
    dbg("REG_CTRL\n")
    dbg("rx[0]:%d\n",RxBuffer[0]);

    TxBuffer[0] = 0; //regmode
    I2CWriteRead(TxBuffer, 1, RxBuffer, 1);
    dbg("REG_MODE\n")
    dbg("rx[0]:%d\n",RxBuffer[0]);

    TxBuffer[0] = 4;
    I2CWriteRead(TxBuffer, 1, RxBuffer, 2);
    dbg("Counter\n");
    dbg("rx[0]:%d\n",RxBuffer[0]);
    dbg("rx[1]:%d\n",RxBuffer[1]);

    TxBuffer[0] = 8; //reg voltage
    I2CWriteRead(TxBuffer, 1, RxBuffer, 2);
    dbg("batt voltage\n");
    dbg("rx[1]:%d\n",RxBuffer[1]);
    dbg("rx[0]:%d\n",RxBuffer[0]);

    TxBuffer[0] = 13; //reg open circuit voltage
    I2CWriteRead(TxBuffer, 1, RxBuffer, 2);
    dbg("Open circuit voltage\n");
    dbg("rx[1]:%d\n",RxBuffer[1]);
    dbg("rx[0]:%d\n",RxBuffer[0]);

    TxBuffer[0] = 22; //reg relax
    I2CWriteRead(TxBuffer, 1, RxBuffer, 1);
    dbg("relax counter\n");
    dbg("rx[0]:%d\n",RxBuffer[0]);

    return StateOfChargePercentage;
}

Resulting Output:
SOC
rx[1]:58
rx[0]:168
REG_CTRL
rx[0]:4
REG_MODE
rx[0]:17
Counter
rx[0]:1
rx[1]:0
batt voltage
rx[1]:6
rx[0]:173
Open circuit voltage
rx[1]:26
rx[0]:180
relax counter
rx[0]:120
result 29
SOC
rx[1]:58
rx[0]:160
REG_CTRL
rx[0]:4
REG_MODE
rx[0]:17
Counter
rx[0]:2
rx[1]:0
batt voltage
rx[1]:6
rx[0]:162
Open circuit voltage
rx[1]:26
rx[0]:179
relax counter
rx[0]:120

Outcomes