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.

BQ20Z95: How can I access the Data Flash through MCU by SMBus(I2C)?

Part Number: BQ20Z95

Dear all:

How can I access the Data Flash through MCU by SMBus(I2C)?

Reading bit sequence:

Start + 0x16 + ACK + 0x77 + ACK + 0x50 + ACK + 0x00 + ACK + Stop

Start + 0x16 + ACK + 0x78 + ACK + rs + 0x17 + ACK + returned LSB + ACK + returned MSB + ACK +.....32byte.....+ Stop

Writing bit sequence:

Start + 0x16 + ACK+ 0x77 + ACK + 0x50 + ACK + 0x00 + ACK + Stop

Start + 0x17 + ACK+ 0x78 + ACK + LSB + ACK + .....32byte.....+ Stop

Is it right?

Thanks!

 

 

《sluu264a_bq20z90-V1.50 + bq29330, bq20z95 Technical Reference》page100:

To write the value of Term Voltage to a value of 8.7 V the following sequence is used.

Read complete Gas Gauging-IT Config subclass (SubclassID = 80) into RAM:

· Write Subclass ID

– SMB Slave Address (0x16)

– SMB CMD 0x77 with 0x0050 as data (=80 decimal)

· Read Subclass (2 blocks are needed as its over 32 bytes long)

– SMBSlave Address (0x16)

– SMB CMD 0x78 receiving 32 bytes of data

– SMB CMD 0x79 receiving 32 bytes of data

Overwrite offset 45 of received data with 8.7 V:

· Update offset 45 of second block with 0x21fc (=8700 decimal)

Write the complete subclass back to the bq20z90/bq20z95:

· Write Subclass ID

– SMB Slave Address (0x16)

– SMB CMD 0x77 with 0x0050 as data

· Write Subclass

– SMB Slave Address (0x17)

– SMB CMD 0x78 with 32 bytes of data

– SMB CMD 0x79 with 32 bytes of data

  • Hi Yj,

    As described in Appendix A: Standard SBS Commands in the TRM (found here: http://www.ti.com/lit/sluu264 ), first write the sub command to Manufacturer Access, then read from manufacturer access for the result. I have written out the steps below.

    When using EVSW, please go to the Pro screen.

    For Manufacturer Access (0x00) sub command Device Type (0x0001)

    Write SMB Word:
    1) SMB: 00
    2) Word: 0001
    3) Click Write

    Read SMB Word:
    1) SMB: 00
    2) Click Read
    3) View Result

    For Manufacturer Access (0x00) sub command Firmware Version (0x0002)

    Write SMB Word:
    1) SMB: 00
    2) Word: 0002
    3) Click Write

    Read SMB Word:
    1) SMB: 00
    2) Click Read
    3) View Result

    For Manufacturer Access (0x00) sub command Hardware Version (0x0003)

    Write SMB Word:
    1) SMB: 00
    2) Word: 0003
    3) Click Write

    Read SMB Word:
    1) SMB Command: 00
    2) Click Read
    3) View Result

    To Read ManufacturerData (0x23)

    Read SMB Block:
    1) SMB: 23
    2) Click Read
    3) The ASCII and HEX results will be shown in the Result Fields.

    To Write ManufacturerData (0x23)

    Write SMB Block:
    1) SMB: 23
    2) Block Data: (your values in hex, with a space between each byte, e.g., 0123 4567 89AB CD)
    2) Click Write

    Writing to and reading from data flash is similar to using the commands as shown above, however, the data flash is organized into sublcasses where each data flash variable is assigned an offset within its numbered subclass.

    Please ensure your device is not sealed, or the data flash commands will be NACK'ed.

    Read and writing subclass data are block operations which are each 32 bytes long, but data may be written in shorter block sizes. Please ensure that you do not write over the subclass boundary.

    Using the instructions above as illustrative examples of how to read and write with subclass commands, please follow those steps but with 0x77 for the dataflash subclass id and 0x78 through 0x7F for the dataflash sub class pages 1 - 8, respectively.

    For example:

    To write the value of Term Voltage to a value of 8.7 V the following sequence is used.
    Read complete Gas Gauging-IT Config subclass (SubclassID = 80) into RAM:
    • Write Subclass ID
    – SMB Slave Address (0x16)
    – SMB CMD 0x77 with 0x0050 as data (=80 decimal)
    • Read Subclass (2 blocks are needed as its over 32 bytes long)
    – SMBSlave Address (0x16)
    – SMB CMD 0x78 receiving 32 bytes of data
    – SMB CMD 0x79 receiving 32 bytes of data

    For more examples, please refer to Appendix C of the TRM found here: http://www.ti.com/lit/sluu264

    Sincerely,
    Bryan Kahler
  • Hi,
    I am very sorry, obviously I didn't explain my question clearly.
    I used MCU to read the parameters of bq20z95 through SMBus. I havn't got EVSW, just reading and writing through MCU.
    I can use SBS Command and ManufacturerAccess(0x00) to read from bq20z95. Like bit sequence:
    Start + 0x16 + ACK+ 0x00 + ACK + Manufacturer Access Subcommand LSB + ACK + Manufacturer Access Subcommand MSB + ACK + Stop
    Start + 0x16 + ACK+ 0x00 + ACK + 0x17 + ACK + returned LSB + ACK + returned MSB + ACK + Stop
    But I don’t know how to write data to bq20z95. And I don’t know how to read or write the Data Flash through MCU.
    Regards,