Hi, I'm trying to communicate with the BQ78350 after its sealed so I can read the available registers like x0050 Safety Alert via the Manufacturer Block Read 0x44 command.
Its not working and the only thing we can think of is that my Micro Controller is not using PEC. PEC is not needed for reading word functions.
I have the [HPE] bit set to 0 because my Micro Controller code does not have the PEC function included.
Here is the function code were using to return data from 0x44, register 0x0050, but it never returns the correct info:
Here is the function code that we are using:
int BQ20Z45::readStringB(uint8_t address, char* result, int len)
{
int pos = 0;
int newlen;
// Initiate a manufacturer_block_Read
Wire.beginTransmission(BQ20Z45_Address);
Wire.write(0x44);
Wire.write(0x02);
Wire.write(address);
Wire.write(0x00);
Wire.endTransmission(false);
newlen = Wire.requestFrom(BQ20Z45_Address, len + 1,true);
if (newlen > 0)
{
newlen--;
Wire.read();
for (pos = 0; pos < newlen; pos++)
result[pos] = Wire.read();
}
result[pos] = '\0'; // append the zero terminator
return newlen;
}
There is another guy who seems to have this working and he is getting the following return, I have contacted him for advice also:
Please Help! This is the only part we have left to complete to have full communication with the fuel gauge.