Other Parts Discussed in Thread: BQSTUDIO
Dear TI Expert,
I am encountering a confusing issue while debugging battery balancing.
-
After using the command
Subcommands(CB_ACTIVE_CELLS, 1 << 8, W2);
I immediately use
scssCopy codeSubcommands(CB_ACTIVE_CELLS,0x00,Rd); Battery_Now.balanceState = ((uint16_t)RX_32Byte[1] << 8) | RX_32Byte[0]; printf("balanceState = %x\r\n",Battery_Now.balanceState);
The result is:
balanceState = 100
-
However, if I use
Subcommands(CB_ACTIVE_CELLS, 1 << 8, W2);
and then wait for 1s (as mentioned in the TRM manual: "For writing, this command starts balancing the specified cell. Write 0x0000 to turn off balancing. This command may take about 1 second to take effect.")After a delay of
delay_ms(1000);
and then usingscssCopy codeSubcommands(CB_ACTIVE_CELLS,0x00,Rd); Battery_Now.balanceState = ((uint16_t)RX_32Byte[1] << 8) | RX_32Byte[0]; printf("balanceState = %x\r\n",Battery_Now.balanceState);
The result is:
balanceState = 0
;
I am unsure why this is happening, as it seems the balance command is not being executed.
Here is my complete battery balancing configuration code:
void SettingsCellBalancingConfig(void)
{
// Set battery balancing configuration - accept host-controlled balance commands. Allow automatic battery balancing in relax, charge mode, and sleep mode.
// [Configuration settings]
BQ769x2_SetRegister(BalancingConfiguration, 0x07, 1); //0000 0111
// When the battery's lowest temperature is below this value, balancing is not allowed (-128~127°C).
BQ769x2_SetRegister(MinCellTemp, -0x14, 1); //-20°C
// When the battery's highest temperature is above this value, balancing is not allowed (-128~127°C).
BQ769x2_SetRegister(MinCellTemp, 0x3C, 1); //60°C
// When the internal temperature is above this value, balancing is not allowed (-128~127°C).
BQ769x2_SetRegister(MaxInternalTemp, 0x46, 1); //70°C
/*
The battery balancing algorithm recalculates which battery to balance after this many seconds. (1~255 s)
Once a battery is chosen, it will continue balancing that battery for this interval unless one of the conditions preventing balancing exists.
This interval is also used for host-controlled balancing commands. The command to balance a battery will keep it balanced for this period.
The host can resend the command before the timer expires to reset it and continue balancing.
*/
BQ769x2_SetRegister(CellBalanceInterval, 0x3C, 1); //60s (Battery balancing interval)
// This limits how many batteries can be balanced simultaneously through the CB_SET_LVL command or automatic parallel balancing. (0~16)
// With host-controlled balancing, the host can specify more units than this and ignore the limit.
BQ769x2_SetRegister(CellBalanceMaxCells, 0x0F, 1); // 16
// [Charging mode settings]
// During charging, automatic battery balancing is disabled if the minimum cell voltage is below this threshold (0~5000 mv).
BQ769x2_SetRegister(CellBalanceMinCellVCharge, 0x09C4, 2); //2500mv
// During charging, the difference between the maximum and minimum cell voltages must be greater than this value for automatic balancing to occur (0~255mv).
BQ769x2_SetRegister(CellBalanceMinDeltaCharge, 0x05, 1); //5mv
// In charging balance, balancing stops once the difference between the minimum and maximum cell voltages falls below this threshold (0~255mv).
BQ769x2_SetRegister(CellBalanceStopDeltaCharge, 0x01, 1); //1mv
// [Relax mode settings]
// When discharging or not charging, automatic battery balancing is disabled if the minimum cell voltage is below this threshold (0~5000 mv).
BQ769x2_SetRegister(CellBalanceMinCellVRelax, 0x09C4, 2); //2500mv
// When discharging or not charging, the difference between the maximum and minimum cell voltages must be greater than this value for automatic balancing to occur (0~255mv).
BQ769x2_SetRegister(CellBalanceMinDeltaRelax, 0x05, 1); //5mv
// When discharging or not charging, balancing stops once the difference between the minimum and maximum cell voltages falls below this threshold (0~255mv).
BQ769x2_SetRegister(CellBalanceStopDeltaRelax, 0x01, 1); //1mv
}
I have attached a screenshot from my bqStudio software for your reference.
Please advise. Thank you.