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.

MSPM0G1506: Internal thermometer results are not output correctly

Part Number: MSPM0G1506
Other Parts Discussed in Thread: SYSCONFIG

Hello. My name is Mori.

I checked the internal thermometer, but it didn't give me the expected results.
I checked when the outside temperature was 23.3℃, but the result was 4℃.
TEMP_SENSE0.DATA was set as 749 and the AD value was output as 1907. (Vref is 1.4v)
The AD value will be about 100 counts higher than expected.

• TSc = -1.8 mV/C
• TEMP_SENSE0.DATA = 749
• TSTRIM = 30℃
• ADCCODE = 1907

VSAMPLE(mv): 1907 * 1400 / 4096 ≒ 651
VTRIM(mv): 749 * 3300 / 4096 ≒ 603
TSAMPLE: (1/-1.8) * (651 - 603) + 30 ≒ 4

I have attached an image of the SysConfig settings.
Please let me know if there is anything wrong.

  • Hi Mori,

    The Temperature Sensor Calibration factor uses reference of 3.3V and the trim temperature was taken at 25 C.

    //Formula found in TRM Section 2.2.5
    #define TEMP_TS_TRIM_C                                            ((uint32_t)25)
    /*
     * Constant below is (1/TSc). Where TSc is Temperature Sensor coefficient
     * available in the device datasheet
     */
    #define TEMP_TS_COEF_mV_C                                             (-571.42f)
    
    //Gets the voltage for the trim temp, this is done at 25 C
    float VTrim = 3.3/4096 * (DL_SYSCTL_getTempCalibrationConstant() -0.5);
    
    //Gets the voltage for the sample from the ADC
    float Vsample = 3.3/4096 * (adcResult - 0.5);
    
    //Takes the voltage from trim and ADC to get temperature in C
    float gTemperatureDegC = (1/TEMP_TS_COEF_mV_C * 1000) * (Vsample - VTrim) + TEMP_TS_TRIM_C;
    
    //converts C to F
    float gTemperatureDegF = 9.0/5.0 * gTemperatureDegC + 32;

    I notice the discrepancy between the code and what the datasheet says for the Temperature sensor coefficient, so let me look into that for you.

    Regards,

    Luke

  • Hi Luke

    Thank you for your reply.
    I understand that the datasheet and code are different.
    Thank you for your investigation.

    ・TSc = -571.42mV/C
    ・TSTRIM = 25℃

    I tried to check the operation, but the output was 24.9℃ compared to the outside temperature = 23.4℃.
    It's almost the same as TSTRIM, but
    Proceed with this setting for now.

    Thank you for your response.