what is Adc_TempSenseGetTemp parameter?

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

what is Adc_TempSenseGetTemp parameter?

Jump to solution
661 Views
rlaxortn
Contributor IV

i am using s32ds 3.6version, and RTD 4.0.0. mcu is s32k314 172pin.

 

Adc_TempSenseGetTemp parameter has 2 parameters in adc document. 

but when i use Adc_TempSenseGetTemp function, this needs 3 parameters. 

i understand that parameters are hwunitType, tempinstance, tempvaule. 

but i don't understand tempinstance. 

tempinstance is 49? that is channel number.  or other thing?

what i input for tempinstance?

 

this is my adc config. 

3.png

5.png

 

this is function.

2.png

 

this is document.

 

 

4.png

 

 

1. i understand hwUnitType is adcHwUnit_1, and tempVaule is for returnning variable value. 

but i don't understand what i input tempinstance. channel number or other thing?

 

2. and i wanna use senser temp in MCU. 

so what process is for using temperature sensor in mcu?

i think process is

Adc_Sar_Ip_TempSenseEnable -> Adc_Sar_Ip_TempSenseGetTemp 

 

3. what is Adc_TempSenseCalculateTemp?

after use Adc_Sar_Ip_TempSenseGetTemp, do i have to use Adc_TempSenseCalculateTemp?

 

thanks to help.

Tags (3)
0 Kudos
Reply
1 Solution
633 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

Senlent_0-1752653202127.png

u32AdcInstance-> The ADC instance you're using right now

u32TempInstance->0, because only have one Temp Instance

pTempSenseVal->the Calculated temperature value

View solution in original post

0 Kudos
Reply
3 Replies
643 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

1.The RTD driver includes LLD and HLD, which are no-autosar and autosar compliant.

These two functions are derived from LLD and HLD respectively.

Adc_Sar_Ip_TempSenseCalculateTemp();//for lld dirver

Adc_TempSenseGetTemp ();//for hld driver

 

I have already provided you with a routine in your previous question.

https://community.nxp.com/t5/S32K/s32k344-tempsensor/m-p/2133907#M50911

 

2.yes

 

3.No.
a.Adc_Sar_Ip_TempSenseGetTemp() ->This function starts a normal software conversion with one-shot mode on tempsense channel and calculates the temperature on chip from the data conversion


b."Adc_TempSenseCalculateTemp()"->calculates the temperature based on given data(if read directly using ADC)

 

0 Kudos
Reply
638 Views
rlaxortn
Contributor IV

@Senlent 

 

my question is i don't understand what i input tempinstance. channel number or other thing?

so i show you function parameter. 

 

 

0 Kudos
Reply
634 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@rlaxortn

Senlent_0-1752653202127.png

u32AdcInstance-> The ADC instance you're using right now

u32TempInstance->0, because only have one Temp Instance

pTempSenseVal->the Calculated temperature value

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2134540%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ewhat%20is%20Adc_TempSenseGetTemp%20parameter%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2134540%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ei%20am%20using%20s32ds%203.6version%2C%20and%20RTD%204.0.0.%20mcu%20is%20s32k314%20172pin.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAdc_TempSenseGetTemp%20parameter%20has%202%20parameters%20in%20adc%20document.%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20when%20i%20use%26nbsp%3BAdc_TempSenseGetTemp%20function%2C%20this%20needs%203%20parameters.%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20understand%20that%20parameters%20are%20hwunitType%2C%20tempinstance%2C%20tempvaule.%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20i%20don't%20understand%20tempinstance.%26nbsp%3B%3C%2FP%3E%3CP%3Etempinstance%20is%2049%3F%20that%20is%20channel%20number.%26nbsp%3B%20or%20other%20thing%3F%3C%2FP%3E%3CP%3Ewhat%20i%20input%20for%20tempinstance%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ethis%20is%20my%20adc%20config.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F347747iEB26AC440BB13EB0%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%223.png%22%20alt%3D%223.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%225.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%225.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F347746i63406AFEFED9E8D2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%225.png%22%20alt%3D%225.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ethis%20is%20function.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F347748i91E1CA2E861121CF%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222.png%22%20alt%3D%222.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ethis%20is%20document.%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%224.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%224.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F347749i92FBBA9881B1FC16%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%224.png%22%20alt%3D%224.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E1.%20i%20understand%20hwUnitType%20is%20adcHwUnit_1%2C%20and%20tempVaule%20is%20for%20returnning%20variable%20value.%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20i%20don't%20understand%20what%20i%20input%20tempinstance.%20channel%20number%20or%20other%20thing%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E2.%20and%20i%20wanna%20use%20senser%20temp%20in%20MCU.%26nbsp%3B%3C%2FP%3E%3CP%3Eso%20what%20process%20is%20for%20using%20temperature%20sensor%20in%20mcu%3F%3C%2FP%3E%3CP%3E%3CSPAN%3Ei%20think%20process%20is%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAdc_Sar_Ip_TempSenseEnable%20-%26gt%3B%26nbsp%3BAdc_Sar_Ip_TempSenseGetTemp%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3E3.%20what%20is%26nbsp%3BAdc_TempSenseCalculateTemp%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Eafter%20use%26nbsp%3BAdc_Sar_Ip_TempSenseGetTemp%2C%20do%20i%20have%20to%20use%26nbsp%3BAdc_TempSenseCalculateTemp%3F%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3Ethanks%20to%20help.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2134774%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20what%20is%20Adc_TempSenseGetTemp%20parameter%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2134774%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3Erlaxortn%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_0-1752653202127.png%22%20style%3D%22width%3A%20542px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_0-1752653202127.png%22%20style%3D%22width%3A%20542px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F347801i8DA4DFEE819CB913%2Fimage-dimensions%2F542x153%3Fv%3Dv2%22%20width%3D%22542%22%20height%3D%22153%22%20role%3D%22button%22%20title%3D%22Senlent_0-1752653202127.png%22%20alt%3D%22Senlent_0-1752653202127.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Eu32AdcInstance-%26gt%3B%20The%20ADC%20instance%20you're%20using%20right%20now%3C%2FP%3E%0A%3CP%3Eu32TempInstance-%26gt%3B0%2C%20because%20only%20have%20one%20Temp%20Instance%3C%2FP%3E%0A%3CP%3EpTempSenseVal-%26gt%3Bthe%26nbsp%3BCalculated%20temperature%20value%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2134750%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20what%20is%20Adc_TempSenseGetTemp%20parameter%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2134750%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F188029%22%20target%3D%22_blank%22%3E%40Senlent%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Emy%20question%20is%26nbsp%3B%3CSPAN%3Ei%20don't%20understand%20what%20i%20input%20tempinstance.%20channel%20number%20or%20other%20thing%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Eso%20i%20show%20you%20function%20parameter.%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2134739%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20what%20is%20Adc_TempSenseGetTemp%20parameter%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2134739%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22mailto%3AHi%40rlaxortn%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EHi%40rlaxortn%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E1.The%20RTD%20driver%20includes%20LLD%20and%20HLD%2C%20which%20are%20no-autosar%20and%20autosar%20compliant.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThese%20two%20functions%20are%20derived%20from%20LLD%20and%20HLD%20respectively.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAdc_%3CSTRONG%3ESar_Ip%3C%2FSTRONG%3E_TempSenseCalculateTemp()%3B%2F%2Ffor%20lld%20dirver%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAdc_TempSenseGetTemp%26nbsp%3B()%3B%2F%2Ffor%20hld%20driver%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3EI%20have%20already%20provided%20you%20with%20a%20routine%20in%20your%20previous%20question.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2Fs32k344-tempsensor%2Fm-p%2F2133907%23M50911%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2Fs32k344-tempsensor%2Fm-p%2F2133907%23M50911%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3E2.yes%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3E3.No.%3CBR%20%2F%3Ea.Adc_Sar_Ip_TempSenseGetTemp()%20-%26gt%3BThis%20function%20starts%20a%20normal%20software%20conversion%20with%20one-shot%20mode%20on%20tempsense%20channel%20and%20calculates%20the%20temperature%20on%20chip%20from%20the%20data%20conversion%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CBR%20%2F%3Eb.%22Adc_TempSenseCalculateTemp()%22-%26gt%3Bcalculates%20the%20temperature%20based%20on%20given%20data(if%20read%20directly%20using%20ADC)%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E