bq20z80-V101
www.ti.com
SLUS625D–SEPTEMBER 2004–REVISED OCTOBER 2005
Writing a SubClass
Information required:
•
•
•
SubClassID
Number of bytes in the subclass
32 bytes of initialized data to be written. Less than 32 bytes is acceptable if a subclass contains less than 32
bytes in the last block.
Procedure:
1. Write the SubClassID using the SMBus Word Write protocol.
–
–
Command = SubClassAccess command as specified in the data sheet
Word = SubClassID
2. Write a block of data using SMBus Block Write protocol.
–
–
Command = DataFlashClassSubClassx as specified in the data sheet
If a subclass has more than 32 bytes, then to get the next 32 bytes, use Command =
DataFlashClassSubClassx +1
Example
To write the value of DF:Terminate 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
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 38 of received data with 8.7 V
Update offset 38 with 0x21fc
Write the complete subclass back to the bq20z80
•
•
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
Alternatively, only the required block rather than the full subclass can be accessed.
Read required block of Gas Gauging-IT Config subclass (SubclassID = 80) into RAM
•
Write Subclass ID
– SMB Slave Address (0x17)
– SMB CMD 0x77 with 0x0050 as data
Read Subclass (2nd block is needed as its offset 38)
– SMB Slave Address (0x16)
•
– SMB CMD 0x79 receiving 32 bytes of data
Overwrite offset (38 - 32 = 6) of received data with 8.7 V
Update offset 6 with 0x21fc
Write the updated block back to the bq20z80
Write Subclass ID
•
•
43