Hello,
I'm trying to read Temperature sensor value that is calibrated by TI.
I use two calibration points provided by TLV located at 01A00h.
But my problem is that we always get around 10 degree difference between what MSP430 measures and actual.
Fluke 289 measures MSP430 temperature as -20C, but MSP430 internal sensor returns -6C. (while environment temperature is steady for 3-4 hours)
Fluke 289 measures MSP430 temperature as +60C, but MSP430 internal sensor returns 67C.
Fluke gets the temperature just top of the MSP430. And the MCU consumes 5mA only with 8Mhz MCLK at the time of measurement, I don't think it heats itself.
What I believe that internal temperature sensor accuracy after the TLV calibration data is 3 degree. So 10 degree is not acceptable. What could be the potential problem?
ADC10CTL0 = 0; ADC10CTL0 = ADC10SHT_7 | ADC10ON; // S&H=192 ADC clks; Enable ADC10, temperature sample period must be greater than 30 us, so min s/h is 168 adcclk ADC10CTL1 = ADC10SHP; // MODCLK = 5.6Mhz max from internal UCS ADC10CTL2 = ADC10RES; // 10-bit conversion results ADC10MCTL0 = ADC10SREF_1 | ADC10INCH_10; // internal Vref+, A10 temp. sensor REFCTL0 = REFMSTR | REFVSEL_1 | REFON; // Select internal ref = 2.0V __delay_cycles(750u); // provide delay for reference settling ~75us // Enable ADC10 and start conversion ADC10CTL0 |= ADC10ENC | ADC10SC; while (ADC10CTL1 & ADC10BUSY) { } s32 temperature_adc_val = ADC10MEM0; ADC10CTL0 &= ~ADC10ENC; temperature_adc_val = ((temperature_adc_val - m_DeviceDesc.Content.ADC20T30) * (85L - 30L) * 4096L / (m_DeviceDesc.Content.ADC20T85 - m_DeviceDesc.Content.ADC20T30)) + (4096L * 30L); temperature_adc_val /= 4096L; if ((temperature_adc_val >= -45L) && (temperature_adc_val <= 90L)) { // update temperature value if it is in the range, otherwise keeps previous value *TEMPE = temperature_adc_val; }
-----------------------------
typedef struct { u8 InfoLength; // 1A00h 1 u8 CRCLength; // 1A01h 1 u16 CRCValue; // 1A02h 2 u16 DeviceID; // 1A04h 2 u8 HardwareRevision; // 1A06h 1 u8 FirmwareRevision; // 1A07h 1 u8 DieRecordTag; // 1A08h 1 u8 DieRecordLength; // 1A09h 1 u32 LotID; // 1A0Ah 4 u16 XPosition; // 1A0Eh 2 u16 YPosition; // 1A10h 2 u16 TestResult; // 1A12h 2 u8 ADCCalibrationTag; // 1A14h 1 u8 ADCCalibrationLength; // 1A15h 1 s16 ADCGainFactor; // 1A16h 2 s16 ADCOffset; // 1A18h 2 s16 ADC15T30; // 1A1Ah 2 s16 ADC15T85; // 1A1Ch 2 s16 ADC20T30; // 1A1Eh 2 s16 ADC20T85; // 1A20h 2 s16 ADC25T30; // 1A22h 2 s16 ADC25T85; // 1A24h 2 } TDeviceDescriptors;