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

die temperature 51822

hi Ole Morten:

thank you for your great support.

i have tested nrf6310\temperature_example. at 30(Celsius)

I checked the data. NRF_TEMP=0x000002AF; TEMP=0xFFFFFFAC; what's the NRF_TEMP data type? 10bit 2's complement or 32bit 2's complement? which position is for sign(+/-)? result=10 = 10* 0.25 celsius.right? how to work out the result of die temperature?

int main(void) { int32_t volatile temp; int32_t temp_valve;

nrf_temp_init(); nrf_gpio_range_cfg_output(8, 15);

while(true) { NRF_TEMP->TASKS_START = 1; while ((NRF_TEMP->EVENTS_DATARDY & TEMP_INTENSET_DATARDY_Msk) != (TEMP_INTENSET_DATARDY_Set << TEMP_INTENSET_DATARDY_Pos)) { } NRF_TEMP->EVENTS_DATARDY = 0; temp = (nrf_temp_read()/4); NRF_TEMP->TASKS_STOP = 1; /* Stop the temperature measurement */

nrf_gpio_port_write(NRF_GPIO_PORT_SELECT_PORT1, (uint8_t)(temp));

nrf_delay_ms(500); } }

kind regards

kevin chen

from china

Parents
  • Hi Kevin,

    It's the 32bit 2's complement with the actual max (positive and negative) value of 10 bit. So for example if the temperature value (0.25oC unit) is -2 you will have: 0xFFFFFFFE. And the maximum negative value it can get is 0xFFFFFC00.

    Note that, on the first version of the chip, a bug fix is needed, please refer to PAN document, issue #28 (already fixed in the SDK) Secondly, even on new chip version (XLR2), manual offset calibration, in some cases, are still needed.

Reply
  • Hi Kevin,

    It's the 32bit 2's complement with the actual max (positive and negative) value of 10 bit. So for example if the temperature value (0.25oC unit) is -2 you will have: 0xFFFFFFFE. And the maximum negative value it can get is 0xFFFFFC00.

    Note that, on the first version of the chip, a bug fix is needed, please refer to PAN document, issue #28 (already fixed in the SDK) Secondly, even on new chip version (XLR2), manual offset calibration, in some cases, are still needed.

Children
No Data
Related