Other Parts Discussed in Thread: BQ79606EVM-897
We are using Temperature sensor configuration on GPIO1 Pin of IC BQ79606A.
As per given in data sheet we have performed below steps for calculation of Temperature in degree Celsius.
step 1:
ReadReg(0x00, AUX_GPIO1_HU , 3, 0, FRMWRT_SGL_R); // read 3 byte of data starting from address AUX_GPIO1_HU register
step 2:
Temp_Reg_2sComp = TwosComplement_24bit((int32_t)((int32_t)BMS_Rx_Data.response_data[0] << 16) | ((int32_t)BMS_Rx_Data.response_data[1] << 8) | BMS_Rx_Data.response_data[2]); // taken 2s complement of 24 bit data
step3:
TSREF = (Temp_Reg_2sComp * MUL_TSREF);
step 4:
BMS_Parameters.Sense_Temp = (1 / (((log((R1 * R2 * TSREF)/ (R0 * (R1 * TSREF - R2 * (1 - TSREF))))) / TEMP_COEFF) + (CONST))); // Final temperature reading
the ref values used in the program are listed below :
#define TEMP_COEFF (3380)
#define CONST (0.04) //(1/25)
#define R1 (5100)
#define R2 (57600)
#define R0 (10000)
#define MUL_TSREF (0.00007628)
#define ENABLE_TSREF 0x10
#define START_CELL_ADC_CONV 0x01
#define START_AUX_ADC_CONV 0x02
configuration of temperature sensor registers is as per below list:
AUX_ADC_CTRL1 = 0x11
GPIO_ADC_CONF = 0x00
CONTROL2 = ENABLE_TSREF | START_CELL_ADC_CONV | START_AUX_ADC_CONV
But we are not getting any variation in temperature reading even if we change the readings to hi- low extremes. Please review the above steps and give your suggestion.
I have attached the file which we have used for TEMPERATURE CALCULATION.Temperature Calculations.xlsx
Thank you in Advance.
Mandar S