This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ76942: 校准CC2电流阻值配置失败

Part Number: BQ76942


SRP SRN 引脚之间使用2/3毫欧姆的电阻,按说明手册对Calibration:Current:CC Gain 和Calibration:Current:Capacity Gain 进行配置,但是读出来的电阻值仍然是按默认电阻值1毫欧采集出来的电流值,请问配置该寄存器还需求什么配置吗?例如写保护解除之类的。以下是配置代码示例

/******************************************************************************
* 名  	称:  bq76952_CURRENT_PARA_CONFIG
* 功  	能:	 配置CC2电流采集,电阻阻值校准
* 入口参数:  无
* 出口参数:  ret_fg:0-配置失败;1—配置成功
*******************************************************************************/
uint8_t bq76952_CURRENT_PARA_CONFIG(void)
{
	uint8_t ret_fg = false;
	uint8_t u8WriteBuff[40] = {0};
	
	u8WriteBuff[0] =  11;//配置CC Gain, SRP 和 SRN 引脚之间的电阻阻值为2/3mΩ,见datasheet 123页
	ret_fg = bq76942_AFE_WRITE_FUNC(MEM_CC_GAIN,1,u8WriteBuff, SUBCOMMAND);
	delay_ms(55);
	
	u8WriteBuff[0] =  11;//配置CC Gain, SRP 和 SRN 引脚之间的电阻阻值为2/3mΩ,见datasheet 123页
	ret_fg = bq76942_AFE_WRITE_FUNC(MEM_CC_GAIN,1,u8WriteBuff, SUBCOMMAND);
	delay_ms(55);
	
	u8WriteBuff[0] =   3345064        & 0xFF;//配置Capacity Gain
	u8WriteBuff[1] =  (3345064 >>8)   & 0xFF;
	u8WriteBuff[2] =  (3345064 >>16)  & 0xFF;
	
//	u8WriteBuff[0] =   (3280878 >> 24) & 0xFF;//配置Capacity Gain
//	u8WriteBuff[1] =   (3280878 >> 16) & 0xFF;
//	u8WriteBuff[2] =   (3280878 >> 8)  & 0xFF;
//	u8WriteBuff[3] =    3280878        & 0xFF;
	ret_fg &= bq76942_AFE_WRITE_FUNC(MEM_CAPACITY_GAIN,3,u8WriteBuff, SUBCOMMAND);
	delay_ms(55);
	
	ret_fg &= bq76942_AFE_WRITE_FUNC(MEM_CAPACITY_GAIN,3,u8WriteBuff, SUBCOMMAND);
	delay_ms(55);
	
	return ret_fg;

}