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.

MSP430FR5739 internal Temperature Sensor, value too high

Other Parts Discussed in Thread: MSP430FR5739, MSP430G2553, MSP-EXP430FR5739

When I try to read the internal temperature sensor in MSP430FR5739, I get values such as 489, 487, etc.

If I use the formula ( ADC10_B ):

· N = 1023·(V_IN - V_REF-)/(V_REF+ - V_REF-)

And:

· V_REF- = AVSS = 0V
· V_REF+ = VREF = 2V

Then the values are:

· N = 489: V_IN = 0.956
· N = 487: V_IN = 0.952

Acording to the datasheet (5.33 REF, Temperature Sensor and Built-In V_MID), I run into the following data:

· T_A = 0ºC --> 790 mV
· TC_SENSOR = { V_CC = 2 or 3 V } = 2.55 mV/ºC

So when I try to get a temperature value, I do something like this:

· Temp = ( V_IN - T_A )/TC_SENSOR

With some numbers:

· Temp = ( 0.956 - 0.790 )/0.00255 = 65.098 ºC

In my opinion, that value is too high, when I used the microcontroller MSP430G2553, I manage to get right values ( around 27ºC ). So my question is, Am I doing anything wrong?

On the other hand, my micro doesn't have any of the temperature calibration values ( I checked it already ) and the setup is well configurated since, I get right values if I change the channel, for example if I read the channel 11: ( AVCC - AVSS )/2, I'm capable of getting right values ( ( 3.6 - 0 )/2 = 1.8V ).


I really appreciate any help you can provide!

  • Do you use the required Sampling time?
    You also need to correct the Result with the calibration values for Vref, ADC and Temperature Sensor. See chapter 1.14.3 of the User’s Guide.
  • Hi Leo:

    Yes, I use the required Sampling time, here's my code when I set up the ADC and REF:

    uint16_t degC = 0;
    
    REFCTL0     |=	 REFON | REFVSEL_1;                                       // V_REF enabled ( 2 V )
    
    ADC10CTL0   &=	 ~ADC10ENC;
    ADC10CTL1      =    ADC10DIV_3 | ADC10SHP | ADC10SSEL_0 | ADC10CONSEQ_2;     // f_ADC10 ~ 4.5/3 MHz, Repeat-single-channel
    ADC10CTL2      =	    ADC10RES;                                                                                                      // ADC10 10-bit
    ADC10MCTL0   =    ADC10SREF_1 | ADC10INCH_10;
    ADC10CTL0      =    ADC10SHT_4 | ADC10MSC | ADC10ON;                                                  // 64/(4.5/3 MHz), ADC10 enabled
    for(degC = 30; degC > 0; degC-- ); // delay to allow reference to settle

    According to the datasheet, the sample time required if channel 10 is selected must be more then 30 us. In my case: 

    · 64/(4.5/3 MHz ) = 42.67 us > 30 us.

    And as I said, my micro doesn't have the calibration values for Temperature Sensor.

    Thank you for your reply!

  • Look at the datasheet

    on page 92 - there is the TLV table (table 8.1) that shows you where the calibration values are located.

    Dennis

  • Hi Dennis:

    I know where the calibration values are located and I even checked them, but unfortunately, mine ones are empty ( the calibration values for temperature I mean ).

    According to this answer:

    · e2e.ti.com/.../958523

    Some MSP430FR5739 ( the first ones ) don't always have all of the temperature calibration values, that's why I ask if someone has this device ( or even better, the MSP-EXP430FR5739 board ) and can check if the internal temperature sensor works well or not.


    I appreciate your reply!

  • Ah, OK. Sorry, then I misunderstood. Unfortunately I do not have that device :-\

    But the values from another device wouldn't be that good, since the data is per unit. But maybe better than nothing...

  • Then next time write the correct device number ‘MSX430…’.
    But the Calibration value’s will not give this big difference, you probably do some wrong calculation.
  • Hi Leo:

    I don't understand what you mean with: Then next time write the correct device number ‘MSX430…’. I bought the MSP-EXP430FR5739 and it has the MSP430FR5739 device...

    About wrong calculation, as I said, those are the figures I get when I work with the ADC10_B module and I use the data which ones are on the datasheet.

    That's why I ask if someone who has this device have been able to read the temperature sensor and say, how to work with it properly.


    I appreciate your answer.

  • Leo meant, that your MSP430FR5739 maybe is a XMS430FR5739 and therefore an engineering sample from the beginning of this LaunchPad series that simply does not have these constants given by the factory.
  • Manuel Caballero said:
    When I try to read the internal temperature sensor in MSP430FR5739, I get values such as 489, 487, etc.

    The name of the EVM is always the same, but the chip on your board is labeled with ‘X430 …’ and not ‘MSP430 …’.

  • Manuel Caballero said:
    and I use the data which ones are on the datasheet.

    You can’t put the straight “Data from the datasheet” into a C source file and let the Compiler figure out what you want to do! You need to translate this first to C-code which defines your calculation.

  • Look at the brand new MSP432 LaunchPad - this one has an XMS432P401R, too. And if you would now sample one, you would only get this XMS device:

  • Hi Leo:

    The chip on my board is small and totally black, to be honest, I spent more than 30 minutes looking at it, and I haven't even seen the label yet.

    I know what you mean, but in practise, I'm talking about the MSP430FR5739 and its internal temperature sensor, and I guess, the data collected is the same for all the family ( engineering sample or not ).

    What I would like to know is, when I get some data from temperature sensor, what that data mean ( or, what I have to do to turn that data into celsius degree ).

    Regards.

  • Manuel Caballero said:
    I know what you mean, but in practise, I'm talking about the MSP430FR5739 and its internal temperature sensor, and I guess, the data collected is the same for all the family ( engineering sample or not ).

    You say "in practice"... in practice, it matters whether you are talking about a production-released device or one of the early silicon prototype devices (MSP430 vs X430 on the chip marking).

    If your chip doesn't have the data, then it doesn't have the data and you can make no accurate conclusion about what it should be. I would recommend replacing the device or getting a new launchpad.

    Manuel Caballero said:
    What I would like to know is, when I get some data from temperature sensor, what that data mean ( or, what I have to do to turn that data into celsius degree ).

    The data you get is the raw ADC sample of the sensor voltage. With offset and gain errors. With sensor non-linearity.

    To turn that into degrees centigrade, you need the calibration values and apply the formula from the User's Guide correctly.

  • Leo Bosch said:

    You can’t put the straight “Data from the datasheet” into a C source file and let the Compiler figure out what you want to do! You need to translate this first to C-code which defines your calculation.

    In my first message, I wrote what value I get and what suppose I have to do with it according to the datasheet. 

    Brian Boorman said:

    To turn that into degrees centigrade, you need the calibration values and apply the formula from the User's Guide correctly.

    So, according to your reply, I can't turn the data ( that I get from internal temperature sensor ) into degrees centigrade if I don't have the temperature calibration values.


    Well, I'm afraid that I will have to use an external device to make my own temperature reference values, anyway, if someone could have the MSP430FR5739 device, I'd be very appreciated if they could read the temperature calibration values and pass them to me.


    Regards and thank you very much for your help!

  • The temperature sensor has three parameters: offset, gain and operating voltage. The operating voltage is the selected reference voltage, and the other two vary greatly for each individual device. Maybe less for devices from the same production wafer or at least the same region of the wafer.
    The values used in the users guide are just average values. The real ones may be far off. The calculations only give a valid result if you know the offset and gain of your specific device.

    The calibration values stored on the MSP don't use this formula at all. They simply tell you which ADC result was measured at 30°C and 80°C. With these two values (given for all available reference voltages), you can calculate the gain/°C as ((CAL80-CAL30)/50) and the offset as (CAL30-30*gain). Subtract this offset form your reading and divide the rest by the gain and you have the temperature in °C.
    Without these values, you have one equation with two unknown variables and therefore an unlimited number of results.

    Without a temperature-controlled environment, it is not easy to do a calibration on your own. You may try the following: measure the ADC reading at room temperate and measure the room temperature. Add 0.1 or 0.2°C to room temperature due to internal heating by the MSPs own power dissipation (keep in mind that the sensor temperature is die temperature, not ambient temperature).
    Then heat up your oven to a temperature in the range of 60-80°C. Put the MSP inside, wait, then read the ADC reading form the sensor and at the same time the oven temperature. Then you may have CAL25 and CAL70 or so, which will allow you to calculate the offset and gain of this specific device using the formula I have given above (of course not /50 then, but /(70-25)).

**Attention** This is a public forum