All trademarks are the property of their respective owners.
A complete list of direct commands can be found in the device-specific Technical Reference Manual. The format for a direct command is shown in the following examples.
Table 1-1 shows the Alarm Enable command that uses command 0x66. By default, the register setting for Alarm Enable is set to 0xF800. In the example, the setting is changed to 0xF082. The data is in little endian format. The device address for the BQ769x2 is 0x10 (8-bits) where the LSB is the R/W bit. A direct command follows the format I2C_Write(I2C_ADDR, Command, DataBlock), so for this example the command would be I2C_Write(0x10, 0x66, [0x82, 0xF0]).
Command | Name | Units | Type | Description |
---|---|---|---|---|
0x66 | Alarm Enable | Hex | H2 | Mask for Alarm Status(). Can be written to change during operation to change which alarm sources are enabled. |
Table 1-2 shows how to read the voltage for Cell 1. The Cell 1 Voltage command is 0x14 and is a read only command. The Cell 1 voltage is read by writing the I2C command 0x14 followed by a 2-byte read. The data is returned in little endian format. In the following example, the 16-bit Cell 1 voltage read 0x0E74, which corresponds to 3700 mV.
Command | Name | Units | Type | Description |
---|---|---|---|---|
0x14 | Cell 1 Voltage | mV | I2 | 16-bit voltage on cell 1 |
Table 1-3 shows how to read the internal temperature sensor. The units for the 16-bit temperature sensor reading are in 0.1 K. In the following example, the reading of 0x0BA6 represents a decimal value of 2982, which is 298.2 K. This converts to about 25°C.
Command | Name | Units | Type | Description |
---|---|---|---|---|
0x68 | Int Temperature | 0.1 K | I2 | This is the most recent measured internal die temperature. |
Table 1-4 shows how to read the 16-bit current measurement from CC2. The current reading in the following example shows 7 mA.
Command | Name | Units | Type | Description |
---|---|---|---|---|
0x3A | CC2 Current | userA | I2 | 16-bit CC2 current |
The Command Sequence module in the BQStudio software enables you to try commands. This tool can also be used to create and save command sequences. The Transaction Log in this example shows all of the commands that have been covered so far.
BQStudio has an Auto Refresh on the Dashboard which periodically reads the registers of the device to refresh the measurements displayed. When using the Command Sequence module, it is recommended to disable Auto Refresh by clicking on the green banner. The banner will turn red to indicate Auto Refresh is disabled (see Figure 1-6).
Subcommands use a different format from direct commands and are accessed indirectly using the 7-bit command address space. They also provide the capability for block transfers. To issue a subcommand, the command address is written to 0x3E/0x3F. If data is to be read back, it will be populated in the 32-byte transfer buffer which uses addresses 0x40 - 0x5F. Multiple examples follow.
The timing required for the device to fetch data depends on the specific subcommand and any other processing underway within the device, so it will vary during operation. The approximate times for each subcommand are shown in the Technical Reference Manual. There are two approaches for addressing this timing when reading data from a subcommand:
Certain subcommands write data to a register and must be followed by a write to 0x60/0x61 with the checksum and length. This only applies to the FET_Control(), REG12_Control(), CB_Active_Cells(), and CB_SET_LVL() subcommands. Examples for calculating checksum and length are provided in the next section since this is also required when writing to RAM registers.
The device number can be read by first writing the subcommand number 0x0001 (little endian) to the command address 0x3E. This is followed by reading from the data buffer at address 0x40. In this example, the device number returned is 0x7694 (which represents BQ76942).
Command | Name | Data | Units | Type | Description |
---|---|---|---|---|---|
0x0001 | DEVICE_NUMBER | Device Number | Hex | U2 | Reports the device number that identifies the product. The data is returned in little-endian format |
The MANUFACTURING STATUS subcommand reads two bytes from the Manufacturing Status register. First, the command 0x0057 is written to 0x3E followed by a read of two bytes from 0x40.
Command | Name | Data | Units | Type | Description |
---|---|---|---|---|---|
0x0057 | MANUFACTURING STATUS | Manufacturing Status | Hex | H2 | Provides flags for use during manufacturing. |
Some subcommands do not require a data read from the data buffer since they only provide an instruction. The FET_ENABLE subcommand is one example. This command is issued by writing 0x0022 to 0x3E.
Command | Name | Description |
---|---|---|
0x0022 | FET_ENABLE | Toggle FET_EN in Manufacturing Status. FET_EN = 0 means FET Test Mode. FET_EN = 1 means Firmware FET Control. |