This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ24195: Error on Reg09

Part Number: BQ24195

Hi Team,

Our customer is using Arduino MKRWiFi1010 that contains BQ24195. According to her, when it gets an error on Reg09, it halts all arduino operations. She is getting the values of 128 and 48. She had reached out to Arduino but was directed to contact us because the device she is reading error codes from is BQ24195. What could be the cause of this error?

Attached are the schematic diagram of MKRWiFi1010 and the source code.  

MKRWiFi1010V2.0_sch.pdf

Reg09.txt
#include <Wire.h>
#include <Arduino_PMIC.h>


#define INPUT_SOURCE_REGISTER               0x00
#define POWERON_CONFIG_REGISTER             0x01
#define CHARGE_CURRENT_CONTROL_REGISTER     0x02
#define PRECHARGE_CURRENT_CONTROL_REGISTER  0x03
#define CHARGE_VOLTAGE_CONTROL_REGISTER     0x04
#define CHARGE_TIMER_CONTROL_REGISTER       0x05
#define THERMAL_REG_CONTROL_REGISTER        0x06
#define MISC_CONTROL_REGISTER               0x07
#define SYSTEM_STATUS_REGISTER              0x08
#define FAULT_REGISTER                      0x09
#define PMIC_VERSION_REGISTER               0x0A

void setup() {
  // put your setup code here, to run once:

    PMIC.begin();
    Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:

Serial.println(readFaultRegister());
delay(2000);

}



int writeRegister(byte address, byte val){
  Wire.beginTransmission(0x6B); //PMIC address
  Wire.write(address);
  Wire.write(val);

  if(Wire.endTransmission(true) != 0){
    return 0;
  }

  return 1;
}

int readRegister(byte address){
  Wire.beginTransmission(0x6B); //PMIC address
  Wire.write(address);

  if(Wire.endTransmission(true)!= 0){
    return -1;
  }

  if(Wire.requestFrom(0x6B,1,true) != 1){
    return -1;
  }

  return Wire.read(); 
}

byte readFaultRegister(){
   int DATA = 0;
   DATA = readRegister(FAULT_REGISTER);
   return DATA;
}
  

Regards,

Danilo

  • Hi Danilo, 

    A read of 48 on Reg09, means the safety timer expired. Meaning the device was trying to charge a battery but was not able to before the safety timer expired. This should not reflect on the MCU being unresponsive, but the fault will be active until is read by the host. A host not responsive, might mean it was not able to read the register so fault will stay active until is read (as long as the charger is powered). You'll need to check on the charging status and charging time of the battery or battery simulator when the Reg09 return 48. 

    A read of 128 on Reg09 means the watchdog expire. For the watchdog to expire means the device either just powered up and is on default mode, or the MCU failed to communicate with the device before the watchdog timer expired (default is every 40s). In case of the device failing to communicate, I would suspect the MCU was not responsive before so all registers were reset and device go back into default mode (not host operated). There is nothing on the charger that would make the Arduino not responsive, but if the Arduino is not responsive (on halt state) then it will not meet the watchdog timer settings requirements, then the charger will return to default state till receive another valid communication from the host.  

    Best regards, 

    Arelis G. Guerrero