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

how to find out Nordic temperature value while sd is enabled

Hi,

I am using Nrf51822 custom board.

i want to store Nordic temperature value for every 15 minutes .

i dont want to use polling method.

Kindly suggest me how to find out temperature value by interrupt method while sd is enabled.

it will be easy if any sample code is there.

Regards Balaji

  • The TEMP peripheral is open even when the softdevice is enabled, so reading the temperature can be done by just starting a measurement and waiting for the ready event.

    The SDK provides a very thin wrapper for this, in nrf_temp.h. Combining this with app_timer should make it easy to do what you need. Beware that there are a couple of PANs on the TEMP peripheral.

    Edit: This is no longer correct with S110 version 6.0.0, which blocks the temp sensor due to its internal usage. You'll therefore have to use the sd_temp_get() function.

  • Calling nrf_temp_init() causes a hard fault in my device with the s110 enabled.

    This line from nrf_temp.h triggers it; *(uint32_t *) 0x4000C504 = 0;

    DId you get it working?

  • With 6.0.0, TEMP is now used by the softdevice and must be used through the softdevice APIs. Please see my edit above.

  • Cheers Ole. Will use that!