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.

LM95071: Temperature readings stops being accurate after a few days of working properly

Part Number: LM95071
Other Parts Discussed in Thread: LM71

Hi team,

My customer is using LM95071 for temperature measurement over SPI. They find that after a day or two of run time it can become stuck sending out the same two bytes, sometimes it’s the device ID as though it were in sleep mode, most recently it was reading 14.6degC and not reacting to heat. 

The read function is being called once per second. I'm also attaching a scope shot of 16 clock pulses to get the two bytes the use. The scope is slow (50MHz) so the clock looks rounded. In the first attachment the output is the device ID. Chip select is green, LM95 output is blue, clock is purple. In the second attachment is is a normal output after reboot showing room temp of 21.21 deg C.

A reboot always fixes it. He is running at 10MHz from the STM32L431 using the following code-

float LM95071_get_degC(void)

{

                int16_t MSB,LSB;

                int16_t count;

 

                // let pending transmissions complete

                while (!LL_SPI_IsActiveFlag_TXE(LM95071_SPI_PORT) || LL_SPI_IsActiveFlag_BSY(LM95071_SPI_PORT)); // wait for transmission to complete

                while(LL_SPI_IsActiveFlag_RXNE (LM95071_SPI_PORT))

                {// make sure FIFO buffer is empty

                                LL_SPI_ReceiveData8(LM95071_SPI_PORT); // read data

                }

                LL_SPI_Disable(LM95071_SPI_PORT);// port must be disabled to change phase and polarity

                LL_SPI_SetClockPolarity(LM95071_SPI_PORT,LL_SPI_POLARITY_LOW);

                LL_SPI_SetClockPhase(LM95071_SPI_PORT,LL_SPI_PHASE_2EDGE);

                LL_SPI_Enable(LM95071_SPI_PORT);// Enable SPI port

                LL_GPIO_ResetOutputPin(LM95071_CS_PORT, LM95071_CS_PIN);// pull LM95071 /cs pin low

                LL_SPI_TransmitData8(LM95071_SPI_PORT,0);  // dummy tx

                LL_SPI_TransmitData8(LM95071_SPI_PORT,0);  // dummy tx

                while (!LL_SPI_IsActiveFlag_TXE(LM95071_SPI_PORT)|| LL_SPI_IsActiveFlag_BSY(LM95071_SPI_PORT)); // wait for transmission to complete

                LL_GPIO_SetOutputPin(LM95071_CS_PORT, LM95071_CS_PIN);// pull LM95071 /cs pin high

                MSB=LL_SPI_ReceiveData8(LM95071_SPI_PORT); // read data

                LSB=LL_SPI_ReceiveData8(LM95071_SPI_PORT) & 0xFC; // read data and clear 2 LSBs

                count=LSB+(MSB<<8); // convert to 2's complement integer

                return((float)count*LM95071_DEGC_PER_LSB); // return degC

}

Any idea of what could be going wrong?

  • Hi Lauren,

    I have a few questions to help clarify. 

    1. Does the reboot that fixes this issue include a power cycle of the device or just a reset of the controller?
    2. After the device is rebooted, does the failure always occur again after just a few days? 
    3. Is this something they are seeing on just 1 device, or multiple different devices? 
    4. Based on the oscilloscope captures I estimate that their clock frequency is 5MHz, is that correct? 

    Best Regards,
    Brandon Fisher

    1. Does the reboot that fixes this issue include a power cycle of the device or just a reset of the controller?

      Yes a power cycle, controller reset does not help

    2. After the device is rebooted, does the failure always occur again after just a few days? 

      Yes

    3. Is this something they are seeing on just 1 device, or multiple different device?

    It's occurring on two boards, both are protoypes and not in production yet.

    4. Based on the oscilloscope captures I estimate that their clock frequency is 5MHz, is that correct? 

    Yes, he slowed it down from 10MHz to 5MHz to see if it would help

  • Hi Lauren,

    Thank you for checking this. A 10MHz clock speed would be above our specification limits, but 5MHz is acceptable, so that was a good test.

    Is there any other traffic on their SI/O Line that isn't shown here?

    Also, it is difficult to gauge their timing here on these oscilloscope shots. Do they have a faster oscilloscope where they can measure their setup and hold times to ensure compliance? 

    Another note, I don't see this on the portion of the schematic they shared, but do they have the 10kOhm resistor on the line on the controller side to prevent contention?

    Best Regards,
    Brandon Fisher

  • Hey Brandon,

    Thanks for your help!

    They are only connected to MISO on the MCU so no 10K, they just read data, no writing to the LM95. They're going to try to see if they can get some faster scope shots.

  • Thanks Lauren - we look forward to the new scope shots

  • Hey Josh,

    Here is a look at the frame at 500nS/div showing clock and /CS - does this help?

  • Hi Lauren,

    The undershoot seems a little concerning given that they seem to be exceeding the -0.3V Abs Max value of the LM95071. On the high-side they appear to be okay, or at least only slightly over the limits. 

    I know they have slowed down from 10MHz to 5MHz already, but can they slow down the clock even further and see if this improves the over and undershoot on their rise and fall? I'd like to see if the issue persists when the voltages are within the absolute maximum ratings.

    Best Regards,
    Brandon Fisher

  • Hey Brandon,

    Actually the ringing is from their scope probes, if they switch to 10:1 it's not present. They really think it's something on the FW side.

    Do you know if we have any code to read the temp from their STM32 MCU (UART)?

    Thanks,
    Lauren

  • Hi Lauren,

    I've been looking around, it does not seem we have any code for the STM32 platform since this is not a TI MCU.

    The Linux Kernel does include some LM71 drivers, https://www.kernel.org/doc/html/latest/hwmon/lm70.html, which are compatible with the LM95071. I believe there are some Linux builds which can be run on STM32 discovery kits: https://elinux.org/STM32. My familiarly with both Linux and STM32 is limited though.

    Edit: Please take a look and let me know if you think this will be helpful in troubleshooting their code. 

    Best Regards,
    Brandon Fisher