This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to calibrate the in-built temperature sensor of MSP430G2xx3?



Hi,

I am using inbuilt temperature sensor of "MSP430G2xx3" to measure temperature. In datasheet, they mentioned that this in-built temperature sensor has to be calibrated for correct output value. But they didn't mentioned how to calibrate the sensor. Could anyone suggest me to calibrate the in-built tem., sensor of MSP430G2xx3.

  • Hi,

    You may want to check out these posts:

    http://e2e.ti.com/support/microcontrollers/msp430/f/166/p/184403/665802.aspx#665802 

    http://e2e.ti.com/support/microcontrollers/msp430/f/166/p/273280/954659.aspx#954659

    You are going to take the temperature sensor calibration data from the addresses listed in the datasheet and perform a two-point calibration. The calibration data are basically what the raw ADC temp sensor result was when the part was tested at different temps with different reference voltages.

    First, figure out which internal reference voltage you want to use. This will determine which calibration constants you are going to use (for example, CAL_ADC_15T85 and CAL_ADC_15T30 are the ADC readings with the 1.5V internal reference at 85C and 30C respectively - you use these two values if you are using the 1.5V ref in your code).

    Then when you get your ADC results, you're going to basically figure out where your ADC result falls along the line connecting the two known values for 30 and 85C - you have basically used the calibration data to plot a line relating the ADC reading and the temperature, and then you find where your result falls on that line.

    This is done with an equation like this: (see how it takes the form of a y = mx + b type of equation - we are making a line from our cal data)

    tempDegC = (rawResult - CAL_ADC_15T30) * (85-30)/(CAL_ADC_15T85 - CAL_ADC_15T30) + 30;

    You can find a good example called MSP430FR57xx_adc10_16.c in the code examples for the FR57xx: http://www.ti.com/lit/zip/slac491 This is for a different device, but it will illustrate the concept. Note that the calibration data on your device will be at a different location, so make sure to check the addresses in the datasheet.

    Regards,

    Katie

  • Hello,

    rethinam subbiah said:
    In datasheet, they mentioned that this in-built temperature sensor has to be calibrated for correct output value

    I believe you found this in the family user guide.  In the specific datasheet for the device you are using there should be two tables that describe the tags and labels used by the ADC calibration tags.  This will give you the address and offset that should be used for calibration.  You can also refer to the code examples for help initializing the temperature sensor.

    Thanks,

    Ryan M. Brown

  • UPDATE: We have posted a new version of the 2xx user's guide that includes more information and equations on how to use the temperature sensor data: www.ti.com/lit/pdf/slau144 See section 24.2.2.1 Temperature Sensor Calibration Data

**Attention** This is a public forum