Other Parts Discussed in Thread: LMT86
Tool/software: Code Composer Studio
Hello,
I have a msp430fr4133 and one LMT86 temperature sensor. I connect sensor at P8.0 -> A8 ( Analog input ). I configurate ADC using driverlib with 10bits resolution "ADC_configureMemory(ADC_BASE, ADC_INPUT_A8,ADC_VREFPOS_AVCC,ADC_VREFNEG_AVSS);".
I see in user guide at section 2.2.9 this formula: T = 0.00355 × (VT – V30ºC) + 30ºC. http://www.ti.com/lit/ug/slau445i/slau445i.pdf
I found in datasheet at section 6.10 https://www.ti.com/lit/ds/symlink/msp430fr4133.pdf V30C.
I tried with this formula to calculate temperature received from ADC and the answer not is good.
#define CALADC_15V_30C *((unsigned int *)0x1A1A)
#define CALADC_15V_85C *((unsigned int *)0x1A1C)
...
adcRes = ADC_getResult(ADC_BASE); // for example reived 577
//Formula I
tempInCD = 0.00355 * ( 577 - CALADC_15V_30C ) + 30;
//Formula II
tempInCD = (adcRes - CALADC_15V_30C ) * ( 85 - 30 ) / ( CALADC_15V_85C - CALADC_15V_30C ) + 30;
With both formulas get a wrong answer.
Before tempInCD do I have to do other operations with "adcRes"?
Please give me an explication step by step with correct formula.