s32k344 tempsensor

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
3,477件の閲覧回数
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,682件の閲覧回数
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,464件の閲覧回数
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,445件の閲覧回数
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,440件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

Please refer to the attachment.

S32K344,S32 DS + RTD 3.0.0 P07

 

0 件の賞賛
返信
3,437件の閲覧回数
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,434件の閲覧回数
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,423件の閲覧回数
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,381件の閲覧回数
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 件の賞賛
返信
3,261件の閲覧回数
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 件の賞賛
返信
3,253件の閲覧回数
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,986件の閲覧回数
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,979件の閲覧回数
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,901件の閲覧回数
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,899件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

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

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

0 件の賞賛
返信
2,683件の閲覧回数
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,677件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

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

0 件の賞賛
返信