Part Number:BQ76952
使用bq76952控制均衡流程:
1,设置均衡配置寄存器 // Set up Cell Balancing Configuration – 0x9335 = 0x03 – Automated balancing while in Relax or Charge modes
tx_3byte[0] = 0x35; tx_3byte[1] = 0x93; tx_3byte[2] = 0x03;
BQ76952_HardWriteReg(BQ_ADDR,0x3E,tx_3byte,3);
Delay_ms(5);
tx_2byte[0] = Checksum(tx_3byte,3); tx_2byte[1] = 0x05;
BQ76952_HardWriteReg(BQ_ADDR,0x60,tx_2byte,2);
2、控制指定电池均衡
//控制电池均衡
void BQ76952CellBalance(uint8_t channel)
{
uint16_t val = 1<<channel; //channelÎ为需要均衡的电池编号 1-16
uint8_t tx_2byte[4];
tx_2byte[0] = 0x83, tx_2byte[1] = 0x00,tx_2byte[2] = val>>8, tx_2byte[3] = val&&0xFF;
BQ76952_HardWriteReg(BQ_ADDR,0x3E,tx_2byte,4);
Delay_ms(1000);
}
3、读取均衡的电池
uint16_t BQ76952ACTIVE_CELLS(void)
{
uint8_t tx_2byte[2];
uint16_t rel;
tx_2byte[0] = 0x83, tx_2byte[1] = 0x00;
BQ76952_HardWriteReg(BQ_ADDR,0x3E,tx_2byte,2);
Delay_ms(1);
rel = BQ76952_HardReadReg(BQ_ADDR, 0x40);
Delay_ms(1000);
return rel;
}
写入指定的均衡电池编号后, 然后再读出的均衡电池一直为0,请查看一下这个异常原因,谢谢!
Star Xu:
您好,您参考下面文档的3 独立平衡算法和设置,4 主机平衡算法注意事项
https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_电源管理_zhcaai2.pdf