This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Missing temperature values

Hi Nordic

We are using the die temperature sensor on an nRF51822 we have observed a strange behavior. Some specific values seem to never be returned in the temperature value register. For example: we are never seeing the values for 49.75, 48.5, 47.25 and 46 degrees. These missing values are 1.25 degrees apart and this pattern, with a few exceptions, seems to be present at least from 40 to 70 degrees. The same values are missing on all units we logged. Is this a known issue and if so is there a workaround?

This is the code we are currently using:

int32_t GetTemp(void)
{
    int32_t temp;

    // Workaround for PAN_028 rev2.0A anomaly 31 - TEMP: Temperature offset value has to be manually loaded to the TEMP module
    *(uint32_t*)0x4000C504 = 0;

    NRF_TEMP->TASKS_START = 1;

    while (NRF_TEMP->EVENTS_DATARDY == 0)
        continue;

    NRF_TEMP->EVENTS_DATARDY = 0;

    // Read the 10 bit 2's complement value and transforms it to a 32 bit 2's complement value.
    temp = NRF_TEMP->TEMP;

    // Workaround for PAN_028 rev2.0A anomaly 28 - TEMP: Negative measured values are not represented correctly
    if ((temp & 0x00000200) != 0)
        temp |= 0xFFFFFC00;

    // Workaround for PAN_028 rev2.0A anomaly 30 - TEMP: Temp module analog front end does not power down when DATARDY event occurs.
    NRF_TEMP->TASKS_STOP = 1;

    return temp;
}

This figure shows how some values are missing. Some steps are larger than the others. This does not seem to be due to the temperature changing too fast because the same values are missing on all the units.

Related