Non-working libraries for bq769x0 based monitors

Hi,

Im reverse engineering a bms. i have all the hardware connections down. it has a stm32f103c8, and bq7693003. there are 2 libraries for this chip but both are not working! this is a picture of the bms. and this is the model of the bms. the library I'm using is called: 10s_Ti_BQ76930_BMS I'm using the example code in the github repo.

after having one of the gpios as the boot pin for the BQ7693003 it boots up and says this in the serial console:

 8
 0x08
 Starting BMS object
 Starting wire.begin
 starting variable initialization
 Starting boot pin check
 Determining i2c address and whether CRC is enabled
 Address and CRC detection successful
 Address: 8
 CRC Enabled: 1

And it gets stuck there.

In the bq769x0.cpp i uncommented the BootPin code to start my bq7693003 automatically. before it was not turning on. but now it does and gets stuck as mentioned above.

 // Boot IC if pin is defined (else: manual boot via push button has to be
 // done before calling this method)
 Serial.println("Starting boot pin check");
 if (bootPin >= 0)
 {
 pinMode(bootPin, OUTPUT);
 digitalWrite(bootPin, HIGH);
 delay(5); // wait 5 ms for device to receive boot signal (datasheet: max. 2 ms)
 //pinMode(bootPin, INPUT); // don't disturb temperature measurement
 delay(1000); // wait for device to boot up completely (datasheet: max. 10 ms)
 }

Theres also another problem it will not compile because of this:

 // check for overrun of millis() or very slow running program
 if (abs(secSinceInterrupt - secSinceErrorCounter) > 2) {
 secSinceErrorCounter = secSinceInterrupt;
 }

I think i fixed this by using fabs instead of abs.
i added various delays to the code but still it isint working properly.

Im really not sure what to do, as i have no idea how to code for I2C and this chip. also, i have tried the LibreSolar library it gets far to the clearing of various errors such as XR, Alert, UV, OV.. etc but gets stuck after clearing the XR error.

Regards

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.