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?
thanks for help.
Solved! Go to Solution.
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?
Hi@rlaxortn
yes,you're right.
please take a look at the S32K3xx_RM:
i don't understand example in s32k3xxRM document.
1. can i get source code and explain in detail?
2. is that right i set configure adc temperature sensor?
i get result this.
0xf0e is 3854, 0xf1a is 3866.
how is calculate for getting temperature?
i wanna to be explain about
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.
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.
i build that and i get a temperature data.
but i don't know this is temperature data. because data is so weird.
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.
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?
/* Transform to float number. */
Temperature = ((TemperatureRaw&0x7FF0)>>4) + (TemperatureRaw&0x0F)/16.0F;
if ((TemperatureRaw & 0x8000) != 0)
{
Temperature = -(Temperature);
}
can you explain this source detail?
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.
”
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?
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
Hi@rlaxortn
5V->0b0101_0000->0x50->80
5.5V->0b0101_0101->0x55->85
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?
Hi@rlaxortn
This is my oversight. 5V->0b0101 was mistakenly written as 0b0011