EB_MCAL - MCU Internal Temperature

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

EB_MCAL - MCU Internal Temperature

3,728 Views
Venu_M
Contributor III

Hello NXP team,

I was connected with NXP Team member SENLENT. He said create a new question with EB as a subject name. Can you share the info with respect to the EB tool.

I tried with this post https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K3-Temperature-Sensor-S32-DS-V3-5-RTD-2-...

I am getting the value for this on data variable by using Adc_StartGroupConversion () instead of using Adc_Sar_Ip_GetConvData().

For tempsense variable is not updating correctly always its giving 6733(Tca0) value in Tempsense variable so its giving an result as high temperature.

How to read MCU internal temperature sensor value through ADC.

Venukumar_0-1689847776287.png

 


How to configure this pin in the EB_configuration.
which pin need to configured for this.

Adc_Sar_Ip_TempSenseEnable();
Adc_Sar_Ip_GetConvData();
Adc_Sar_Ip_TempSenseCalculateTemp();

These Api i used for accessing the values from the register.

Venukumar_1-1689847776675.png

 


After this its Tca1 its going to the vector catch.

Venukumar_2-1689847777126.png

 


its going to the trap_bus_isr and went to vector catch.

Can you tell me the flow or procedure how to access the temperature value (ETS) from MCU chip by using EB tool.

Tags (1)
0 Kudos
Reply
20 Replies

3,710 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi Venukumar,

Follow RM:

Nhi_Nguyen_0-1690944351654.png

To enable Tempsense's features, you need to enable these parameters in EB:

Nhi_Nguyen_1-1690944968256.png

To Tempsense output is input of ADC, you need to enable:

Nhi_Nguyen_2-1690945371645.pngNhi_Nguyen_3-1690946003512.png

Follow RM, to convert from voltage to temperature:

Nhi_Nguyen_4-1690946061866.png

In this expression, TCA0, TCA1, TCA2 are read-only and normally not change(or change just a little bit) and they have value:

Nhi_Nguyen_5-1690946215446.png

So, in your case TCA0 is correct.

I encountered the issue that temperature couldn't convert correctly for the package RTM201 through the function Adc_TempSenseCalculateTemp(), but this issue fixed in the latest version RTM 300_P07 or fixed early. So, if you're using old version, please upgrade it.

For clock, please don't forget to enable this:

Nhi_Nguyen_6-1690946664734.png

 

Best regards,

Nhi

 

 

 

0 Kudos
Reply

3,600 Views
Venu_M
Contributor III

Hi Nhi,

I configured like, what you mentioned.
I'm able to get the value but how i will get the value in a degree based(like 35deg or 56deg)

AdcReadGroupResult_1[8] is the Tempsense channe output(1239).

here i got the value as 3517 by using this Api --> Adc_Sar_Ip_TempSenseGetTemp

 

Can you please tell me how to convert (api)this value into a degree based.

Venukumar_0-1696597311432.png

 

Venukumar_1-1696597323023.png

 

0 Kudos
Reply

3,571 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @Venu_M ,

The return value of the function Adc_Sar_Ip_TempSenseCalculateTemp() is in fixed-point format as description below:

Nhi_Nguyen_0-1696994838606.png

Some expressions used to calculate:

Nhi_Nguyen_1-1696995038647.png

For example:

Nhi_Nguyen_2-1696995062041.pngNhi_Nguyen_3-1696995151407.png

Note:

- Conversion resolution

- Reference Voltage, in my case, Vref is 5V.

Nhi_Nguyen_4-1696995267379.png

Nhi_Nguyen_5-1696995779297.png

 

Seem that there is difference result between expression in RM and driver. I'll contact to SW team and get feedback from them.

Best regards,

Nhi

0 Kudos
Reply

2,962 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @Venu_M ,

All data in this thread that I said as example, they captured from the example that I was attached and sent to you, like this:

Nhi_Nguyen_0-1704355873561.png

Best regards,

Nhi

0 Kudos
Reply

2,951 Views
Venu_M
Contributor III

Hi Nhi,
Can you please check with this RTD SW32K3_RTD_4.4_2.0.0 .
To check the MCU temperature.

0 Kudos
Reply

2,873 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @Venu_M ,

This is result I got from ver 200.

Nhi_Nguyen_0-1704695904040.png

Please put a breakpoint as above image, because I just change channel to ADC for temp sense base on the RTD's example that is available in the package.

 

0 Kudos
Reply

2,913 Views
Venu_M
Contributor III

Hi Nhi,

Can I use this RTD package for MCU Internal Temperature?
Currently we are using SW32K3_RTD_4.4_2.0.0.
Our MCU is S32K342.

Venukumar_0-1704462001015.png

 

Venukumar_1-1704462066174.png

 

0 Kudos
Reply

2,875 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @Venu_M ,

This should be the best package for known issues were fixed. In this package, have no the example for S32K342 so you need to import this project from the previous releases.

Best regards,

Nhi

0 Kudos
Reply

3,545 Views
Venu_M
Contributor III

Hi Nhi,

I'm getting the value as 1239 from adcgroupresult for the tempsensor channel.

1239*(3.3/4095)=0.9984

So, if i calculate by using this formula, the temperature value will be 200+degree.


How to do this .

0 Kudos
Reply

2,922 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @Venu_M ,

Did you try to run the example that I attached to previous comment? In my example, Vref = 5 not 3.3V. You can refer to read me to see board used. Because as far as I know, Changing board make default Vref change. You also need to upgrade to the latest version also.

Best regards,

Nhi

0 Kudos
Reply

3,530 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @Venu_M ,

From my point of view, your problem can come from setting parameters to measure temperature is incorrect. As I said in the previous comment, please take care these parameters:

Nhi_Nguyen_0-1697417188671.png

Best regards,

Nhi

0 Kudos
Reply

3,512 Views
Venu_M
Contributor III

Hi Nhi,

Reference voltage 3.3v
Conversion resolution 12bit

Venukumar_0-1697437604925.png

Venukumar_1-1697437869444.png



Parameters is correct only. But while reading the temperature value giving wrong.

0 Kudos
Reply

3,506 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @Venu_M ,

Because Vref value depends on the board. So, my suggestion that you can use the example that was attached in the package, then you can ensure that setting for ADC is correct, then change one of channel that measured to temperature channel.

For example:

I used this example: 

Nhi_Nguyen_0-1697440045092.png

Follow to 

Nhi_Nguyen_1-1697440067124.png

Vref in my case: 5V.

I changed channel 1 to temperature channel as below:

Nhi_Nguyen_2-1697440250036.pngNhi_Nguyen_3-1697440435619.pngNhi_Nguyen_4-1697440534614.png

Result is as in previous comment. 

Best regards,

Nhi

 

0 Kudos
Reply

3,437 Views
Venu_M
Contributor III

Hi Nhi,

I used the same configuration like 5V as reference like you mentioned.

Venukumar_0-1698837420087.png


I got the value from ADC is 1059 (last value for the temperature sensor) its varying from 1059 to 1887 like that and its reducing in the low level also,

Venukumar_1-1698837497693.png

Venukumar_2-1698837906969.png

This Api I'm using.


I'm confusing for this temperature channel value updating.
Can you share the whole process, I did whatever you mentioned but need a clarity for me.
You mentioned like some RTD  versions. Can you share the link for download as well?

Tags (1)
0 Kudos
Reply

3,409 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @Venu_M ,

I attached an example that I just changed a little bit based on available example that attached in the package. you can try it.

Nhi_Nguyen_0-1699347702220.png

You can read readme to know more information about board used. I'm using the package SW32K3_RTD_R21-11_3.0.0_P07. You can find it at the link: 

https://nxp.flexnetoperations.com/control/frse/product?child_plneID=830617

Best regards,

Nhi

0 Kudos
Reply

2,963 Views
Venu_M
Contributor III
Hi Nhi,
Can you share the RTD package for this version
SW32K3_RTD_R21-11_3.0.0_P07.

Im using this version --> SW32K3_RTD_4.4_2.0.0

So it will be helpful
0 Kudos
Reply

2,958 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @Venu_M ,

You can find the release SW32K3_S32M27x_RTD_R21-11_4.0.0

at the link:

https://nxp.flexnetoperations.com/control/frse/download?agree=Accept&element=3790868

Best regards,

Nhi

0 Kudos
Reply

3,307 Views
aze
Contributor I
 

Is the value of Temp converted to decimal the temperature actually captured by the temperature sensor?

0 Kudos
Reply

3,306 Views
aze
Contributor I
or others?
0 Kudos
Reply

3,566 Views
Nhi_Nguyen
NXP Employee
NXP Employee

Hi @Venu_M ,

SW team confirm that they didn't handle tolerance well. The ticket RTD-24483 raised to improve this. It'll be integrated in the release RTM 400.

Best regards,

Nhi

0 Kudos
Reply