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.

BQ25120: I2C bus transfers

Part Number: BQ25120

The datasheet describes the I2C protocol (i.e. start / address / data / stop, etc) but does not inform of the specific read write to access specific registers on the device.

Do I take it that to read / write specific registers the correct transfer protocol uses the combined format (as described in the I2C spec) with a second byte being written (after the device's bus address) as a register offset and then consecutive read and write bytes in the transfer reading from  / writing to consecutive register addresses after this offset? Or do I need to address each register individually?

  • Hi,
    I'm looking into this. I'll get back to you when i have an answer.
    -Raheem
  • Martyn,

    The combined format is used as you described in your question with only the address being offset. A typical line order is shown below.

    Regards,

    Raheem

  • Hi Raheem,

    Many thanks, that's clear and very useful to know but only first part of the answer.

    What is still unclear is if consecutive registers be read / written in a single access? For typical I2C peripherals this is usually specified.

    I.e. do you need to do for each register:

    <start>-<dev_address+/WR>-<regN_offset>-<re-start+RD>-<read regN_data>-<stop>

    <start>-<dev_address+/WR>-<regN+1_offset>-<re-start+RD>-<read regN+1_data>-<stop>

    <start>-<dev_address+/WR>-<regN+2_offset>-<re-start+RD>-<read regN+2_data>-<stop>

    or can you do:

    <start>-<dev_address+/WR>-<regN_offset>-<re-start+RD>-<read regN_data>--<read regN+1_data>-<read regN+2_data>-<stop>

    And the same for write data?

    I would expect these interface details usually to be described in the data sheet.

  • Martyn,
    You have to read/write one register at a time, not consecutively as quoted below.

    Martyn Gallop said:

    <start>-<dev_address+/WR>-<regN_offset>-<re-start+RD>-<read regN_data>-<stop>

    <start>-<dev_address+/WR>-<regN+1_offset>-<re-start+RD>-<read regN+1_data>-<stop>

    <start>-<dev_address+/WR>-<regN+2_offset>-<re-start+RD>-<read regN+2_data>-<stop>


    Regards,
    Raheem

  • Thanks, that's clear.