Reading the internal temperature of S32K388 using TEMPSENSE module

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

Reading the internal temperature of S32K388 using TEMPSENSE module

857 Views
punithchandra
Contributor III

Hi Team,

We are using the S32K388 MCU. We have a developed a piece of code to read the temperature of the MCU using the available TEMPSENSE module of S32K388.

 

The required MCAL modules are configured including the ADC. We have enabled the below marked parameters as per the user manual. We are testing this on S32K388 Evaluation board.

punithchandra_0-1710314515674.png

 


We are having the UART command so that when the user types the command from the serial terminal, the MCU software reads that command and then reads the internal temperature of MCU using the API Adc_TempSenseCalculateTemp and prints the read results.



As the document says, the read value from the above API is in fixed point format. I have converted these values to the floating point value and printed both the values in the serial terminal.

punithchandra_1-1710314515089.png

 

Below is the command log copy (read multiple times continuously). The yellow highlighted values are converted floating point values while the blue ones are the fixed format value read from the above API.

punithchandra_2-1710314515045.png

 

 

I have observed that the read values change drastically, and the values are ranging from 120 degree centigrades to 190 centigrades. And I doubt that the read values are not correct.

 

Could you please check and let us know your opinion on the above values?

 

Also, I checked the result register for the temperature sensor (ADC channel 49) which is ICDR17 and it' s value keeps changing continuously.

Coming to the configuration we have configured one ADC channel where we have connected external temperature sensor and we are enabling the group conversion, wait for the end of conversion notification function for this group, read the result. Once we readout the external temperature sensor value, then call the function Adc_TempSenseGetTemp to get the temperature from the MCU TEMPSENS module. Since the manual says that the above function is a synchronous call which enables the temperature ADC channel 49, start the conversion, wait for the conversion to complete, read the ADC values, calculate the temperature based on the read value, disables the ADC channel 49 we haven't configured the ADC channel 49 separately.

0 Kudos
21 Replies

107 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

I'm sorry, still waiting. I will let you know as soon as I get the feedback.

0 Kudos