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.

INTERNAL TEMPERATURE SENSOR - TM4C123GH6PM

Other Parts Discussed in Thread: TM4C123GH6PM

Hi,

I came across the below formula in Internal Temperature Sensor in ADC (in TM4C123GH6PM)

VTSENS = 2.7 - ((TEMP + 55) / 75)

What does the 2.7, 55, 75 denotes.

  • Hello Haresh

    These are internal constants that are applied to the device to map the temperature into a voltage, akin to the lines of constants and beta values for a transistor curve. It is not important why these values (As they are derived and characterized from the device) but they should yield the correct temp conversion.

    Regards
    Amit
  • Haresh G said:
    What does the 2.7, 55, 75 denotes.

    VTSENS = 2.7 - ((TEMP + 55) / 75)

    Long past we asked the same - here our findings: (from memory)

    2.7 is the internal sensor's voltage when "TEMP = -55°C."  Substitution of that -55 into the right side of the VTSENS equation yields 2.7V @ TEMP = -55C.  Thus that 55 is an offsetting value to (balance) the temperature equation.

    The nature of the equation reveals that VTENS decreases with rising temperature - reaching 0V when TEMP = 147.5°C.  ((147.5 + 55) /75 = 2.7)  Of course - at 147°C the MCU is unlikely to survive - thus that's a "calculated" (not tested) value.

    The 75 is the scaling factor - which is appropriate for the 202.5°C span of the device's internal temperature sensor.  Simple division then (2.7V / 202.5°C) reveals that the sensor tracks temperature at -13.3mV per degree C.  (i.e. 0.0133 * 202.5 = 2.7  Q.E.D.) 

    That "75" derives from the division of the 202.5°C temperature span by the 2.7V voltage swing - which equals (precisely) 75...

  • I think cb1 explained well all the values. Not much to add on those.

    But if may, i will add something that might arise has doubt, if not for you, maybe others searching for an answer and that find this thread.

    If you want to see better the negative quotient referred " VTENS decreases with rising temperature ", check Figure 13-11. Internal Temperature Sensor Characteristic on the page 814 of the datashet (next page after the formula you asked about).

    Also, probably more practical is the use of the next formula

    •   TEMP = 147.5 - ((75 * (VREFP - VREFN) × ADCCODE) / 4096)

    We do say it's -55ºC not it's 2.7V (which would depend on the sensor also).

    As cb1 refered the maximum ºC is 147.5, that's why it's 147.5-(formula). You check the voltage measure in volts: (VREFP-VREFN)*ADCCODE/4096. ADCCODE is the value you read on the ADC (from 0 to 4095), and VREFP-VREFN is the max voltage read by the ADC, in the case of a launchpad it's 3.3V. 

    More intuitive it might be doing:

    3.3V/4096 = volt per ADC value = ADCStep

    ADCStep*ADCCODE = voltage read =Vread

    Then as cb1 referred, 75 is the number of different voltages the temp sensor gives - each 1ºC starting from -55ºC is a change of -13.3mV starting from 2.7V. So if you are on the "step of voltage" 75, whats the temperature? It's -55+202.5=147.5. So just multiply 75*Vread and what do you get? How far from 147.5ºC you are. 0 means you are on 147.5, 202.5 means you are on -55: This is why it's 147.5-(75*Vread).

    Well i hope cb1 explanation plus what i added helps you any other user that finds this thread.

  • Gentlemen,

    Revisiting this subject, I need a bit of guidance while using the internal temperature with a different external reference.

    I have an external ADC REF, which happens to be 2.5V. It's used on the ADC for some "more noble" purposes than reading the internal temperature, particularly, to read the system's battery pack voltage.

    I configured two inputs in one sequence of the same ADC0: an analog signal on PE3 and the supposed INTERNAL TEMP SENSOR. Among other settings, I have:

    ADCReferenceSet(ADC0_BASE,ADC_REF_EXT_3V); // Terrible macro name when using a voltage such as 2_5V
    MAP_ADCSequenceStepConfigure(ADC0_BASE, 2, 0, ADC_CTL_TS); // Internal temperature
    MAP_ADCSequenceStepConfigure(ADC0_BASE, 2, 1, ADC_CTL_CH0 | ADC_CTL_IE | ADC_CTL_END); // The last step needs to inform that it is the END, and also causes an interrupt.

    External signal conversion is absolutely perfect as expected. But the internal temperature is reading values such as 18 degrees C. I don't have another termometer handy to try and check, but it seems too low (I'm not in Patagonia, it's 30C out the window...)

    Question: when using a different voltage reference, should the datasheet calculation remain? In this case:

    TEMP = 147.5 - ((75 * (2.5) × ADCCODE) / 4096);

    Regards,

  • Hello Bruno,

    Yes, When using an external reference the Temperature Sensor is bounded by the equation

    TEMP = 147.5 - ((75 * (VREFP - VREFN) × ADCCODE) / 4096)

    Regards
    Amit
  • Thanks Amit!

    I had the impression that such temperature was way too low - it had been a while since I dealt with it and on previous projects they used to be on the low 30oC's... But those old PCB's back then were not even "designed", they simply "happened"!

    Anyway, I had a SensorTag that came in yesterday, so I decided to power it up and use the IR thermometer. The TM4C seems to be, in fact, running at ~19oC - which suggests that the numbers I had in the morning were correct! Pushing the processing a bit harder, the most I got during the afternoon was 27.3oC.

    Cold and good piece of information!

    Or in other words, I can't complain, it really a comfortable working environment here... Of course, out there on the field, things will be quite different.

  • Hello Bruno,

    More than comfortable. The on-die temperature sensor must read higher than that. In fact only when the environment is controlled do I see such temperatures.

    Regards
    Amit