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?
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.
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.
/* 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.
”
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?