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.

MSPM0C1104: Repeatability of internal temperature reading

Part Number: MSPM0C1104

I would like to make the most out of an internal temperature sensor. I tested the sensor with LP-MSPM0C1104 LaunchPad. I used ‘adc12_single_conversion’ example from SDK as a reference, changed Vref to internal 1.4 and selected Ch11…

The results were not as good as I expected. I made 100000 consecutive measurements and I get a wide range of results from ADC from 1848 to 1868. See graph below. I expected consequence readings to be more repeatable. What is the reason for so widespread results? Can I do anything to get more repeatable results?

Thx, Goran

  • Hi Goran,

    Very interesting.  I assume this is at room temperature, correct?  Let me take a look at this.

  • Yes, room temperature. lpg

  • Hi Goran,

    I ran same test, Vref = 1.4v.  Readings mostly 1890 but several lower and a few as low as 1750.  Interesting.

    I have a hypothesis the variance may have something to do with noise from the either the system clocks or CPU operating during the ADC sample/conversion.

    I'll repeat the test but but have a timer start the ADC conversions while CPU is in sleep or stop low power modes.  I'll run this by the systems and design team to confirm my hypothesis.

  • Hi Goran,

    As I suspected, the noise seems to be present when the CPU is operating.

    As and example, I changed my setup to use power policy STOP0 and use a timer, running from LFOSC, to generate an event (which starts the ADC sample/conversion) every 20ms.  Don't use timer interrupts as that will force the CPU to wake. When the ADC is done it generates an interrupt which wakes the CPU to read the data, send data out the UART, then CPU goes back into STOP0.

    void send(uint8_t* buffer, uint8_t size)
    {
        uint8_t i;
    
        for (i = 0; i < size; i++)
        {
            DL_UART_Main_transmitDataBlocking(UART_0_INST, buffer[i]);
        }
    }
    
    int main(void)
    {
        SYSCFG_DL_init();
    
        DL_SYSCTL_setPowerPolicyRUN0SLEEP0();
    
        NVIC_EnableIRQ(ADC12_0_INST_INT_IRQN);
        gCheckADC = false;
    
        calibration = (uint16_t)0x41c4003c;
    
        while (1) {
    
            DL_ADC12_enableConversions(ADC12_0_INST);
    
            __WFI();
    
            if(gCheckADC == true)
            {
    
                gAdcResult = DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_0);
                sample++;
                len = sprintf((char*)asciiBuffer, "%d, %d\r\n", sample, gAdcResult);
                send(asciiBuffer,len);
                gCheckADC = false;
            }
        }
    }
    
    void ADC12_0_INST_IRQHandler(void)
    {
        switch (DL_ADC12_getPendingInterrupt(ADC12_0_INST)) {
            case DL_ADC12_IIDX_MEM0_RESULT_LOADED:
                gCheckADC = true;
                break;
            default:
                break;
        }
    }