Hi NXP Community ,
I am facing an issue implementing Balancing in RD-HVBMSCT800BUN
The function I have written to perform it is as follows:
/**
* @brief Perform Global Balancing
*
* @param[in] GlobalBalConfig Set required config
* @param[in] module_bal_list Enabling Balancing for a module
* @param[in] cell_masks set masks for required channel
* @return
*/
HVBMS_Errors global_bal(Bcc_774a_BalConfigurationType *GlobalBalConfig, boolean module_bal_list[BCC_DEVICE_CNT], uint16 cell_masks_bal[BCC_DEVICE_CNT])
{
Std_ReturnType Status = E_OK;
uint8 BCC_Device_Addr;
for (BCC_Device_Addr = 1; BCC_Device_Addr <= BCC_DEVICE_CNT; BCC_Device_Addr++) {
// Check if balancing is enabled for the module
if (module_bal_list[BCC_Device_Addr - 1]) {
GlobalBalConfig->BalChannels0En = cell_masks_bal[BCC_Device_Addr - 1];
GlobalBalConfig->BalSwitchMon0En = cell_masks_bal[BCC_Device_Addr - 1];
// Set global balance configuration
Status |= Bcc_774a_BAL_SetGlobalConfiguration(BCC_CHAIN_ADDR, BCC_Device_Addr, GlobalBalConfig, &BmsTDCfg_Tpl3);
Status |= Bcc_774a_BAL_GetStatus(BCC_CHAIN_ADDR,BCC_Device_Addr,&BmsTDCfg_Tpl3);
if (Status != E_OK) {
// Debug or log the failing device
return ERROR_SET_GLOBAL_BALANCE_FAILED;
}
}
if(PhyError != PHY_NO_ERROR)
{
return ERROR_CMU_START_MEASUREMENT_TD_SEND;
}
// Clear TD configuration
Status |= Bms_TD_Clear(&BmsTDCfg_Tpl3);
}
return NO_ERROR;
}
and later in main.c i am calling it as
Bcc_774a_BalConfigurationType GlobalMinimumSet = {
.CCMBal = false, // Disable constant current balancing
.GlobalUvBal = false, // Enable global undervoltage balancing
.CellUvBal = false, // Disable individual cell undervoltage balancing
.TimerBasedBal = true, // Enable timer-based balancing
.TmpBalEn = false, // Disable temperature-based balancing
.Tmpsrc=BCC_774A_BAL_TMP_SOURCE_AIN0, // Temperature source: AIN0
.PreBalTimer = 0x0000, // Pre-balancing timer: disabled
.GlobalBalTimer = 0xFFFF, // Maximum global balancing timer
.BalChannels0En = 0x0000, // Enable balancing for channels 0 to 7
.BalChannels1En = 0x0000, // Disable balancing for channels 16 and 17
.BalSwitchMon0En = 0x0000, // Enable balancing monitoring for channels 0 to 7
.BalSwitchMon1En = 0x0000, // Disable monitoring for channels 16 and 17
.PWMCycleVoltage = 0xFF // Set PWM cycle voltage to 100%
};
boolean module_bal_list[5] = {0,0,0,0,1};
uint16 cell_masks_bal[5] = {0x0000,0x0000,0x0000,0x0000,0x0FFF} ;
GeneralError = global_bal(&GlobalMinimumSet, module_bal_list, cell_masks_bal);
if(GeneralError != NO_ERROR)
{
Status = E_NOT_OK;
/* Update LED state */
Led_Update(GeneralError, BmsState);
break;
}
But it is not working as expected
I am able to successfully flash code and notice no errors (by leds and freemaster)
but the cells are not discharging
Please help
Hi
Which example are you referring to?
Does the unmodified example work properly?
Best Regards,
Robin
Sorry, It is out of scope of our online technical support. Please contact your local NXP Distributor or FAE for assistance.