Other Parts Discussed in Thread: ADS1018
Tool/software: Code Composer Studio
Hello,
I have a question regarding the example code provided on "ADS1118.c" in 430BOOST-ADS1118-SFT.
/****************************************************************************** * function: local_compensation(int local_code) * introduction: * this function transform internal temperature sensor code to compensation code, which is added to thermocouple code. * local_data is at the first 14bits of the 16bits data register. * So we let the result data to be divided by 4 to replace right shifting 2 bits * for internal temperature sensor, 32 LSBs is equal to 1 Celsius Degree. * We use local_code/4 to transform local data to n* 1/32 degree. * the local temperature is transformed to compensation code for thermocouple directly. * (Tin -T[n-1]) * comp codes = Code[n-1] + (Code[n] - Code[n-1])* {---------------} * (T[n] - T[n-1]) * for example: 5-10 degree the equation is as below * * tmp = (0x001A*(local_temp - 5))/5 + 0x0019; * * 0x0019 is the 'Code[n-1]' for 5 Degrees; 0x001A = (Code[n] - Code[n-1]) * (local_temp - 5) is (Tin -T[n-1]); denominator '5' is (T[n] - T[n-1]) * * the compensation range of local temperature is 0-125. * parameters: local_code, internal sensor result * return value: compensation codes ******************************************************************************/
My question is how are values 0x0019 and 0x001A determined? Is there a lookup table I can reference to?
5degC K-type thermocouple produces a mV of 0.198 and 10deg k-type thermocouple produces a mV of 0.397
Also I will ultimately use an ADS1018 for my project, how are the result data divided and shifted?
Thank you