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.

write to bq20z70 df

Other Parts Discussed in Thread: BQ20Z70

Hi all,

     I have some problem in Accessing bq20z70's Data Flash .it is pass  to write Less than 32 bytes,it is fail to write more than 32 byte . for example,To write the value of Term Voltage to a value of 8.7 V the following sequence is used.

· Write Subclass ID
– SMB Slave Address (0x16)
– SMB CMD 0x77 with 0x0050 as data

delay 100us


· Write Subclass

– SMB Slave Address (0x16)
– SMB CMD 0x78 with 32 bytes of data

SMBD&SMBC are normal

delay 100us

– SMB CMD 0x79 with 32 bytes of data

SMBD&SMBC is abnormal,no 32 bytes of data.

what is the matter?how should i process it??thanks, look forward your reply.

  • The command CAN return up to 32 bytes of data.

    If the subclass has less than 32 bytes, the read command will only return the data length of that particular subclass.

  • SLUU250A–June 2006–Revised June 2006:

    page 78

    Read complete Gas Gauging-IT Cfg 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

    Write the complete subclass back to the bq20z70:
    · 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

    the commands which are red marked should exchange?

    When i read DF, the following sequence is used,Datas are correct.

    Read complete Gas Gauging-IT Cfg 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 (0x17)
    – SMB CMD 0x78 receiving 32 bytes of data
    – SMB CMD 0x79 receiving 32 bytes of data

    I want to know how to write DF subclass ,whose data are more than 32 bytes.what is the following sequence?include the delay.

  • who can answer for me!

  • You actually quoted it in your post: To write first 32 bytes, you use 0x78. For the 2nd page (next 32 bytes), use 0x79... and so on.

    Write the complete subclass back to the bq20z70:
    · 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

  • The address 0x17 is SLA_R,is it right?it should not be used SLA_W 0x16?

  • Part of the device address (bit 0) is a read/write bit. The device address is 0x16. Depends on if it is a read/write, the device address change between 0x16 and 0x17.

    Basically, you will send 0x17 as the device address after re-start in SMBus read write and read block protocols. See the attached SMBus document.

     

     

    SMBus made simple v6.pdf
  • Write the complete subclass (SubclassID = 0)back to the bq20z70:
    · Write Subclass ID
    – SMB Slave Address (0x16)
    – SMB CMD 0x77 with 0x0050 as data

    delay_us(10)

    · Write Subclass
    – SMB Slave Address (0x16)
    – SMB CMD 0x78 with 32 bytes of data

    data can be  writed

     

    Write the complete subclass (SubclassID = 80)back to the bq20z70:
    · Write Subclass ID
    – SMB Slave Address (0x16)
    – SMB CMD 0x77 with 0x0050 as data

    delay_us(10)

    · Write Subclass
    – SMB Slave Address (0x16)
    – SMB CMD 0x78 with 32 bytes of data

    – SMB Slave Address (0x16)
    – SMB CMD 0x79 with 32 bytes of data

    data can not be  writed.my following sequence is right?