bms.reset(); delay(100); // Configure the BQ76952 just the way we like it: bms.setConnectedCells(6); bms.writeByteToMemory(CUV_Threshold, 70); bms.writeByteToMemory(COV_Threshold, 84); // Set OCD1 to 60mV across shunt (200A) bms.writeByteToMemory(OCD1_Threshold, 30); // Set SCD to 80 mV (265 A) bms.writeByteToMemory(SCD_Threshold, SCD_80); // Enable CUV, COV, Short circuit and OCD1 protection // bms.writeByteToMemory(Enabled_Protections_A, 0b10101100); bms.writeByteToMemory(Enabled_Protections_A, 0b11101100); // FET thermistor on DCHG. Enable FET + internal temp protections bms.writeByteToMemory(DCHG_Pin_Config, 0b00001111); bms.writeByteToMemory(Enabled_Protections_B, 0b11000000); // Report in centiamps (10mA),configure for 300uR shunt [default: 1mR] bms.writeByteToMemory(DA_Configuration, 0x06); bms.writeFloatToMemory(CC_Gain, 24.92267); bms.writeFloatToMemory(Capacity_Gain, 7433474.88); // This enables the Pre-discharge function (1600 ms, 2.5 v delta) bms.writeByteToMemory(FET_Predischarge_Timeout, 160); bms.writeByteToMemory(FET_Predischarge_Stop_Delta, 250); bms.writeByteToMemory(FET_Options, 0x1D); // Configures balancing parameters bms.writeIntToMemory(Cell_Balance_Min_Cell_V_Relaxed, 3300); bms.writeByteToMemory(Cell_Balance_Max_Cells, 6); bms.writeByteToMemory(Balancing_Configuration, 0b00000010); // Disables SLEEP, slow measurement speed when balancing to 1/8th bms.writeIntToMemory(Power_Config, 0b0010100010110010); // Exits manufacture mode. Allows BQ to enable FETs subject to protections bms.writeIntToMemory(Mfg_Status_Init, 0x0050); bms.setFET(ALL, ON);