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.

BQ25798: How to preform multi-write and multi-read to the register

Part Number: BQ25798

Per the datasheet, the BQ25798 Ic supports multi-write and read as this:

but some of the registers are 1 byte, and others are 2 bytes, so in the multi-write (or read) transaction, after the first register address is sent, the following data to each of the register

would be either 1 byte or 2 bytes , but the chart above seems to be they are all 1 byte data. How this is handled? 

Or say, the IC would accept all 1 byte data and recognize some of them are 2 bytes accordingly?

  • Ni Nan,

    That figure isn't entirely correct.  The IC can handle single byte or 2 byte writes.

    Regards,

    Jeff

  • Hi Jeff,

    Does it mean that the 1 byte and 2 byte data can be sent mixed and just put them together without aliment?

  • Hi Nan,

    That is my understanding.  I had someone else ask the same question last week and my digital designer replied to question:

    Can the 16-bit registers be written successfully by writing one of the 2 bytes sequentially or is a 2 byte write required?

    with

    Either way, as long as no other address is accessed between the 2 bytes.

    Regards,

    Jeff

  • The register address will not be different in format that the data, how the chip would distinguish it is a address or data between the two ? I mean the multi byte transaction with one address of I2C, but not start another transition.

  • Hi Nan,

    All the figure above is showing is the standard I2C burst read/write. You can read/write any group of registers this way.

     To read/write 16-bit registers correctly you just have to access the low byte and high byte of that register in order, with no other address in between.

    For example, to write charge voltage, you should write address 0x01 first, then 0x02.  If you only write the first byte, nothing will update. If you only write the second byte, the first byte will get garbage.

    You can do this by doing 2 separate writes transactions: the first one writes 0x01, then the second one writes 0x02.

    Or you can use the burst method below and write 2 bytes, starting at 0x01.

    Regards,
    Jeff

  • Thank you very much