Hi everyone,
I wrote an I2C interface for the bq34110 using an MSP430. It's working fine for data commands (e.g. reading the battery voltage with the Voltage() command), but I'm seeing weird behavior when reading the DF and I'm completely unable to write to the DF. Please note that my current setup is a devboard with an MSP430 connected to the devboard of the bq34110 (bq34110EVM-796)
Read to the DF
Here's my I2C sequence when trying to read the Int Coeff 3 register (address 0x41C5). Since I haven't done any modifications to the chip, i'd be supposed to read the default value, i.e 0xCFDC (-12324). However, I get 0xDC17 instead. Here is a screenshot from my logic analyzer:
As you can see, I get 0xDC17 instead of 0xCFDC. By looking at the Technical Reference Manual (TRM), I found that 0x17 is the first byte of the next register (6131 == 0x17F3), meaning that I'm possibly getting the last byte of Int Coeff 3 and the first byte of Int Coeff 4. So, I tried reading from 0x41C4 instead of 0x41C5:
And I get the good data! My question is: is there something wrong with my I2C sequence or is the TRM wrong? Should I always apply this offset when reading the DF?
Writing to the DF
I also tried to write {0x55, 0x54} to Manufacturer Info Block A01 (0x4042) and A02 (0x4043) respectively and read it back, but the device returns 0x00 0x00 everytime. Here is my I2C sequence:
// Write to DF
- Write 0x42 0x40 to MANUFACTURER_ACCESS_CONTROL (0x3E)
- Write 0x55 0x54 to MAC_DATA_0 (0x40)
- Write 0xD4 to MAC_DATA_SUM (0x60) ( 0xD4 == ~( (0x42 + 0x40 + 0x55 + 0x54) & 0xFF ) )
- Write 6 (nData = 2 + 4) to MAC_DATA_LENGTH (0x61)
// Read from DF
- Write 0x42 0x40 to MANUFACTURER_ACCESS_CONTROL (0x3E)
- Read 2 bytes from MAC_DATA_0 (0x40)
My guess is that there is something wrong with the MACDataSum and MACDataLen, but I've followed the steps in slua790 to compute those. I also tried using (LEN = nBytes + 2) instead of (LEN = nBytes + 4), as the TRM says that LEN is the number of bytes involved in the checksum (which contradicts what is said in slua790), but to no avail.
Should I take into account the possible offset that I need to use when reading the DF?
Thank you,
Fred