TI专家您好!
我使用的NTC是CWF1_10KF3950,B值和默认的18k温度模型有差异,所以我根据CWF1_10KF3950的阻值和温度的关系使用TI的在线工具生成校准系数,但是写入后读取的温度为127℃,附件是使用的NTC规格书以及生成的校准参数,请帮忙分析下原因,谢谢!
引脚配置代码如下:
U08 BQ769x2_SetEnableTS1(void)
{
U08 u08Result = 0;
u08Result = BQ769x2_SetRegister(BQ769X2_SET_CONF_TS1, 0x0B, 1);//18K temperature model,
return u08Result;
}
设置18K温度模型校准参数代码如下:
U08 BQ76952_Set18kTempModeCalib(void)
{
//CWF1 10KF3950-B1-500
U08 result = 0;
//Coeff a1 -17995 = 0x10000 - 0x464B = 0xB9B5
result = BQ769x2_SetRegister(BQ769X2_CAL_18K_TEMP_COEFF_A1, 0xB9B5, 2);
//Coeff a2 26324
result |= BQ769x2_SetRegister(BQ769X2_CAL_18K_TEMP_COEFF_A2, 26324, 2);
//Coeff a3 -16652 = 0x10000 - 0x410C = 0xBEF4
result |= BQ769x2_SetRegister(BQ769X2_CAL_18K_TEMP_COEFF_A3, 0xBEF4, 2);
//Coeff a4 31695
result |= BQ769x2_SetRegister(BQ769X2_CAL_18K_TEMP_COEFF_A4, 31695, 2);
//Coeff a5 2793
result |= BQ769x2_SetRegister(BQ769X2_CAL_18K_TEMP_COEFF_A5, 2793, 2);
//Coeff b1 -14950 = 0x10000 - 0x3A66 = 0xC59A
result |= BQ769x2_SetRegister(BQ769X2_CAL_18K_TEMP_COEFF_B1, 0xC59A, 2);
//Coeff b2 13924
result |= BQ769x2_SetRegister(BQ769X2_CAL_18K_TEMP_COEFF_B2, 13924, 2);
//Coeff b3 -6450 = 0x10000 - 0x1932 = 0xE6CE
result |= BQ769x2_SetRegister(BQ769X2_CAL_18K_TEMP_COEFF_B3, 0xEF94, 2);
//Coeff b4 4428
result |= BQ769x2_SetRegister(BQ769X2_CAL_18K_TEMP_COEFF_B4, 4428, 2);
//Adc0 default is 11703
// result |= BQ769x2_SetRegister(BQ769X2_CAL_18K_TEMP_COEFF_ADC0, 11703, 2);
return result;
}
读取温度代码如下:
S32 BQ769x2_ReadThermistorTemp(TE_BQ769X2_THERMISTOR thermistor)
{
U08 cmd;
S16 TemValue;
switch (thermistor)
{
case E_TH_TS1:
cmd = BQ769X2_CMD_TEMP_TS1;
break;
case E_TH_TS2:
cmd = BQ769X2_CMD_TEMP_TS2;
break;
case E_TH_TS3:
cmd = BQ769X2_CMD_TEMP_TS3;
break;
case E_TH_HDQ:
cmd = BQ769X2_CMD_TEMP_HDQ;
break;
case E_TH_DCHG:
cmd = BQ769X2_CMD_TEMP_DCHG;
break;
case E_TH_CFETOFF:
cmd = BQ769X2_CMD_TEMP_CFETOFF;
break;
case E_TH_DFETOFF:
cmd = BQ769X2_CMD_TEMP_DFETOFF;
break;
case E_TH_INT:
cmd = BQ769X2_CMD_TEMP_INT;
break;
}
BQ769x2_DirectRead_Int2(cmd,&TemValue);
float raw = TemValue / 10.0;
return (lroundf(raw - 273.15));
}
CWF1_10KF3950-report.zipCWF1 10KF3950-B1-500.pdfCWF1_10KF3950.zip