s32k344 tempsensor

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

s32k344 tempsensor

跳至解决方案
3,151 次查看
rlaxortn
Contributor IV

i am using s32k344 evb T172.

and i watched ADC TEMPSENSOR in RM Document. 

so does it just read ADC? this ADC TEMPSENSOR is for measuring for MCU Temperature?

this TEMPSENSOR is internal features in MCU?

 

1.png

thanks for help.

标记 (2)
0 项奖励
回复
1 解答
2,356 次查看
rlaxortn
Contributor IV

@Senlent 

 

you respond this :

Hi@rlaxortn

5V->0b0011_0000->0x50->80

5.5V->0b0011_0011->0x55->85

 

but is 0b0011_0000-> 0x30, so is it not 5.0V?right?

i don't understans why 0b0011_0011 is 0x55?

 

if i wanna set 5V-> 0b0101_0000->0x50, it is 5V. right?

在原帖中查看解决方案

0 项奖励
回复
15 回复数
3,138 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

yes,you're right.

please take a look at the S32K3xx_RM:

Senlent_0-1747373995572.png

 

0 项奖励
回复
3,119 次查看
rlaxortn
Contributor IV

@Senlent 

i don't understand example in s32k3xxRM document. 

 

4.png

 

7.png

 

4-1.png

5.png

6.png

1. can i get source code and explain in detail?

 

2. is that right i set configure adc temperature sensor?

i get result this. 

rlaxortn_0-1747378774293.png

0xf0e is 3854, 0xf1a is 3866.

how is calculate for getting temperature?

0 项奖励
回复
3,114 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

Please refer to the attachment.

S32K344,S32 DS + RTD 3.0.0 P07

 

0 项奖励
回复
3,111 次查看
rlaxortn
Contributor IV

@Senlent 

 

i wanna to be explain about 

8.png

 

what is mean 0x7ff0, 0x0f, 0x8000...?

what is that parameter?

example is same configure with my project configure.

 

i need to understand i apply formula for getting mcu temperature.

then i can apply to my project.

but i don't under stand that soucecode. because i don't understand why set 0x7ff0, 0x0f, 0x8000.

 

thanks for help.

标记 (1)
0 项奖励
回复
3,108 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

TemperatureRaw is 16 bits wide, the highest bit is the sign bit (0x8000->0b1000,0000,0000,0000), the lower 4 bits are decimal places (0x0f), and the rest are integer bits.

0 项奖励
回复
3,097 次查看
rlaxortn
Contributor IV

 

@Senlent 

 

i build that and i get a temperature data. 

but i don't know this is temperature data. because data is so weird. 

9.png

 

rlaxortn_0-1747389114724.png

 

although this data is Fahrenheit or Degree Celsius, data is so weird. 

here is maybe 20 Degree Celsius.

 

what is wrong i do...?

 

thank to help.

 

0 项奖励
回复
3,055 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

Have you tested the demo I provided?

What hardware are you using and is the reference voltage of the internal temperature sensor set correctly?

0 项奖励
回复
2,935 次查看
rlaxortn
Contributor IV

@Senlent 

 

/* Transform to float number. */

Temperature = ((TemperatureRaw&0x7FF0)>>4) + (TemperatureRaw&0x0F)/16.0F;

if ((TemperatureRaw & 0x8000) != 0)

{

Temperature = -(Temperature);

}

 

can you explain this source detail?

 

 

0 项奖励
回复
2,927 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

I have already answered your question in my previous answer.

TemperatureRaw is 16 bits wide, the highest bit is the sign bit (0x8000->0b1000,0000,0000,0000), the lower 4 bits are decimal places (0x0f), and the rest are integer bits.

0 项奖励
回复
2,660 次查看
rlaxortn
Contributor IV

@Senlent 

 

i know. so is that data is Fahrenheit or Celsius?

i got that data. 

if i set wrong voltage, default vaule is 53. 

so what i set value? can i get formula?

0 项奖励
回复
2,653 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

1.i know. so is that data is Fahrenheit or Celsius?

Celsius,

 

2.if i set wrong voltage, default vaule is 53. so what i set value? can i get formula?

53->0b0011_0101->3.5V

0 项奖励
回复
2,575 次查看
rlaxortn
Contributor IV

@Senlent 

 

if i set wrong voltage, default vaule is 53. so what i set value? can i get formula?

53->0b0011_0101->3.5V

 

1. how is set 5V and 5.5V?

 

thanks to help.

标记 (1)
0 项奖励
回复
2,573 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

5V->0b0101_0000->0x50->80

5.5V->0b0101_0101->0x55->85

0 项奖励
回复
2,357 次查看
rlaxortn
Contributor IV

@Senlent 

 

you respond this :

Hi@rlaxortn

5V->0b0011_0000->0x50->80

5.5V->0b0011_0011->0x55->85

 

but is 0b0011_0000-> 0x30, so is it not 5.0V?right?

i don't understans why 0b0011_0011 is 0x55?

 

if i wanna set 5V-> 0b0101_0000->0x50, it is 5V. right?

0 项奖励
回复
2,351 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

This is my oversight. 5V->0b0101 was mistakenly written as 0b0011

0 项奖励
回复