Internal Temperature (TSENS0-1) in MPC5744P (MBD)

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

Internal Temperature (TSENS0-1) in MPC5744P (MBD)

Jump to solution
1,491 Views
abhishek_kumar1
Contributor IV

Hello 

I am using NxP Model Based Design Toolbox for MPC57xx an the micro used is MPC5744P (144LQFP)

I want to get the internal temperature (TSENS0 and TSENS1), as shown in below snapshot.

I looked into the ADC block (in Simulink Libraries) but ADC0 - 15 is not a electable option.

Is it because it is not available for 144LQFP and 257BGA (as in package column in the below snapshot it is grayed out for Package Availability, so a bit confusing. Ext pin should be grayed out but not the Package Availability).

If it is available, then how can I access TSENS0-1?

Thanks for your help. 

pastedImage_1.png

Best Regards,

Abhishek

1 Solution
1,167 Views
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com‌,

I finally managed to find what's wrong in your model.

1. In the ADC Config Block it has no influence the order of the channels, because in the result the refPMC will be the first result and the TSENS will be the second result. The results are ordered after the channels number this case AN10 and AN15.

pastedImage_1.png

2. After that I've compared the raw ADC outputs from your model and mine. The raw values were the same so the problem was in the conversion formula, which was modified that the one from the model attached. So I've found two things: The first one is that the inputs for the Conversion Subsystems were reversed: refPMC with the TSENS, and this is the reason why I started with a little explanation at the first point. 

pastedImage_3.png

The second reason is that one gain for the formula was applied only on the second member of the sum and not for the entire sum. In the following screenshot I've highlighted the old position vs the right one. 

pastedImage_4.png

I've also added the Kelvin to Celsius conversion for the Temp0 and this is the FreeMaster screenshot. I've also attached the model with the TSENS0 formula changed and the FreeMaster project too.

pastedImage_5.png

Hope this helps you!

I'm waiting for your reply!

Best Regards, 

Marius

View solution in original post

11 Replies
1,167 Views
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com‌,

As I promised, here is a quick patch to have access to the internal temperature TSENS0 and TSENS1 on the MPC5744P. Officially it will be available in the next release on MPC57xx Toolbox. 

Please replace the p files in the folder src\mbdtbx_mpc574x\mbdtbx_mpc574x\mscripts\adc.

I've also attached an example on how to access the K0-3 values from Flash using custom code because unfortunately this release has no support for accessing a custom flash memory address but we will fix this in the next one. 

I got also inspired from this topic Example MPC5744P TSENS temperature calculation.

Waiting for your response,

Marius

0 Kudos
1,167 Views
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com‌,

Did the attached files help you to measure the internal temperature on the MPC5744P?

Best Regards,

Marius!

0 Kudos
1,167 Views
abhishek_kumar1
Contributor IV

Dear Marius

I get the reading for 0 degrees every time. Today I am not at work. I'll send you the model and screenshot on Monday.

Best Regards

Abhishek

0 Kudos
1,168 Views
abhishek_kumar1
Contributor IV

mariuslucianandrei

Please see what I get in Freemaster (below snapshot)

Mostly I get 0.16 degree Celcius. Which seems to be a bit odd. 

The files you sent had incorrect channels selected in them for ADC so I edited the file a bit :smileyhappy:. Hope its okay. 

I have attached the files.

Thank you for help.

pastedImage_1.png

0 Kudos
1,168 Views
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com‌,

I finally managed to find what's wrong in your model.

1. In the ADC Config Block it has no influence the order of the channels, because in the result the refPMC will be the first result and the TSENS will be the second result. The results are ordered after the channels number this case AN10 and AN15.

pastedImage_1.png

2. After that I've compared the raw ADC outputs from your model and mine. The raw values were the same so the problem was in the conversion formula, which was modified that the one from the model attached. So I've found two things: The first one is that the inputs for the Conversion Subsystems were reversed: refPMC with the TSENS, and this is the reason why I started with a little explanation at the first point. 

pastedImage_3.png

The second reason is that one gain for the formula was applied only on the second member of the sum and not for the entire sum. In the following screenshot I've highlighted the old position vs the right one. 

pastedImage_4.png

I've also added the Kelvin to Celsius conversion for the Temp0 and this is the FreeMaster screenshot. I've also attached the model with the TSENS0 formula changed and the FreeMaster project too.

pastedImage_5.png

Hope this helps you!

I'm waiting for your reply!

Best Regards, 

Marius

1,168 Views
abhishek_kumar1
Contributor IV

Dear mariuslucianandrei

It works now.

And thank you for letting know the that data stream is arranged based on channel number. 

Best Regards

Abhishek

1,168 Views
abhishek_kumar1
Contributor IV

Dear mariuslucianandrei

I can not see the patch!

Best Regards

Abhishek

0 Kudos
1,168 Views
mariuslucianand
NXP Employee
NXP Employee

Sorry abhishek.kumar@chassisbrakes.com,

I hit Add Comment too soon. They shout be available now!

Marius

0 Kudos
1,168 Views
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com‌,

Right now the toolbox does not allow the user to measure the internal uc temperature. Let us investigate this and we will provide a way to measure it soon.

Best Regards, 

Marius

0 Kudos
1,168 Views
abhishek_kumar1
Contributor IV

Dear mariuslucianandrei

Thank you.

Will you reply on the same question once you have the solution?

Best Regards

Abhishek

0 Kudos
1,168 Views
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com‌,

I will reply here the proposed solution probably at the beginning of the next week.

Best Regards, 

Marius

0 Kudos