Hi, I'm writing a library for the BQ27742-G1 fuel gauge, I don't have any problem at all when reading standard commands like Voltage(), Temperature(), etc. but I'm being unable to read back control commands like HW_VERSION, FW_VERSION, etc. Most likely I'm doing something wrong.
For reference, this is what I do to retrieve HW_VERSION:
Issuing the command and subcommand:
- Write: address | 0x00 | 0x00 | 0x02 | STOP
Write control address to read the results
- Write: address | 0x00
Then I read back 2 bytes (for 0x00 and 0x01) but I'm always getting 0x8018 as a result, no matter what subcommand I write. I also noted that If I read the control register without issuing any previous command I get the same value (0x8018).
Any help would be greatly appreciated.
Thanks
EDIT: I detached and attached again the battery from the fuel gauge board and now I'm getting 0x0008 instead, no matter what subcommand I write.