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用I2C读取data flash位序是如何的?

Other Parts Discussed in Thread: BQ29330

在bq20z95的技术手册Page100.(sluu264a_bq20z90-V1.50 + bq29330, bq20z95 Technical Reference.pdf)

有访问data flash的例子,把它写成C语言的I2C位序是这样的吗?:

读出位序:

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

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

写入位序:

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

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

我想这是肯定不对的,正确的是如何的呢?

非常感谢!

C.1.4 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
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