s32k344 tempsensor

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

s32k344 tempsensor

Jump to solution
3,146 Views
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.

Tags (2)
0 Kudos
Reply
1 Solution
2,351 Views
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?

View solution in original post

0 Kudos
Reply
15 Replies
3,133 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

yes,you're right.

please take a look at the S32K3xx_RM:

Senlent_0-1747373995572.png

 

0 Kudos
Reply
3,114 Views
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 Kudos
Reply
3,109 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

Please refer to the attachment.

S32K344,S32 DS + RTD 3.0.0 P07

 

0 Kudos
Reply
3,106 Views
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.

Tags (1)
0 Kudos
Reply
3,103 Views
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 Kudos
Reply
3,092 Views
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 Kudos
Reply
3,050 Views
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 Kudos
Reply
2,930 Views
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 Kudos
Reply
2,922 Views
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 Kudos
Reply
2,655 Views
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 Kudos
Reply
2,648 Views
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 Kudos
Reply
2,570 Views
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.

Tags (1)
0 Kudos
Reply
2,568 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

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

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

0 Kudos
Reply
2,352 Views
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 Kudos
Reply
2,346 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

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

0 Kudos
Reply