Chip_TSen_SetResolution

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Chip_TSen_SetResolution

857 Views
aresmarser
Contributor III

Hi Sir,

I am using NHS3100 kit and developped something based on the SDK project "app_demo_dp_tlogger".

I want to config the resolution of the temperature sensor to test and verify it.

I read the NHS3100 data sheet and user manual.

 As my understanding, If I set the resolution(bit) to "TSEN_9BITS  = 4, /*!< 9 bits resolution */", the resolution (℃) should be ±0.2℃. That is, the temperature will be a multiplier of 0.2.

It looks like the function "Chip_TSen_SetResolution" can use to config the resulution(bit).

I tried to modified the code and the code snippet is below:

--- original code snippet --

int TMeas_Measure(TSEN_RESOLUTION_T resolution, TMEAS_FORMAT_T format, bool synchronous, uint32_t context)

{

//...

  Chip_TSen_SetResolution(NSS_TSEN, resolution);

//...

}

-- modified code snippet ---

int TMeas_Measure(TSEN_RESOLUTION_T resolution, TMEAS_FORMAT_T format, bool synchronous, uint32_t context)

{

//...

  Chip_TSen_SetResolution(NSS_TSEN, TSEN_9BITS);

//...

}

I build, run the program to test but it looks the new resolution didn't work.

From my observation from the tlogger app (the status screen will show "Current temperature:"), the temperature was always a multiplier of 0.1, instead of 0.2.

I am confused.

Anyone can help to review if anything wrong?

Many thanks,

Arna

Labels (1)
0 Kudos
5 Replies

639 Views
driesmoors
NXP Employee
NXP Employee
0 Kudos

639 Views
aresmarser
Contributor III

Hi Kan,

I just force to change resolution "TSEN_9BITS" and check SP0 register which did change to 100b(9-bit mode).

But the same phenomenon was observed as my previous comment.

I use my mobile phone running the android app tlogger to tag the NHS3100 device and observe. But the status screen "Current temperature:" (or "Live temperature:") of the tlogger show the temperature was always a multiplier of 0.1, instead of 0.2.

--- my test code snippet --- forcing resolution to TSEN_9BITS  = 4, /*!< 9 bits resolution */

/* Set the resolution for the Temperature Sensor */
void Chip_TSen_SetResolution(NSS_TSEN_T *pTSen, TSEN_RESOLUTION_T resolution)
{
//    printf("Chip_TSen_SetResolution %d\r\n", resolution);
 resolution = TSEN_9BITS;
    pTSen->SP0 = (pTSen->SP0 & (~(0x7u << 1))) | ((resolution & 0x7u) << 1);
//    printf("Chip_TSen_SetResolution forcing to change %d\r\n", resolution);
}

--------------------

TSEN_SP0_resolution.png

UM10876_TSENS_SP0.png

DS_8.16.2_TSENS_resolution.png

I am very confused why the resolution didn't take effect?

Could you review if anything wrong?

Thanks a lot.

Arna

0 Kudos

639 Views
aresmarser
Contributor III

Hi Kan,

Thank you for your reply.

(1)

I run the "app_demo_dp_tlogger" with LPCXpresso IDE connected the NHS3100 board.

Then I use my mobile phone running the android app tlogger to tag the NHS3100 device and observe. But the status screen "Current temperature:" (or "Live temperature:") of the tlogger show the temperature was always a multiplier of 0.1, instead of 0.2.

Is it the proper test way?

(2)

I didn't checked the content in SP0.

How to verify if the data changed based the new resolution correctly?

Thanks,

Arna

0 Kudos

639 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Arna,

(1) Yes, I think it is right.

(2) check the register address as below:

pastedImage_1.png

Best Regards,

Kan

0 Kudos

639 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Arna,

Did you run the application with a debugger? Have you checked the content in SP0 after you found the tlogger app still showed a data of a multiplier of 0.1? Please kindly clarify.

Thanks for your patience!

Best Regards,

Kan

0 Kudos