s32k312 ADC

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

s32k312 ADC

Jump to solution
2,471 Views
fengba_360
Contributor III

Hello, I'm working with the ADC sampling function of the s32k312 and I'm trying to understand how the values are stored in the adc1_result[] array when I call the function Adc_Sar_Ip_GetConvDataToArray(ADCHWUNIT_1_INSTANCE, ADC_SAR_IP_CONV_CHAIN_NORMAL, ADC1_CHANNEL_NUM, adc1_result); to retrieve the ADC sampling results.

Specifically, I want to know if the values in the adc1_result[] array are stored based on the configured channel numbers of ADC1, for example:

adc1_result[0] stores the conversion result of p0_chanNum0
adc1_result[1] stores the conversion result of p1_chanNum1
And so on, in a sequential manner.
Or, are they stored based on the actual ADC channel numbers and their corresponding positions in the ADC configuration, like:

adc1_result[0] stores the conversion result of adcchannel0 which might correspond to S19_ChanNum43
adc1_result[1] stores the conversion result of adcchannel1 which might correspond to S20_ChanNum44
And so forth.
I'm looking for clarification on how the results are mapped to the adc1_result[] array微信图片_20240911112743.png

0 Kudos
Reply
1 Solution
2,429 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Sorry, there is very little information about Adc_Sar_Ip_GetConvDataToArray, so I did a test: I adjusted the order of Adc Physical Channel Name in Channel configurations arry, but the order of ADC result did not change.

Adc_Sar_Ip_GetConvDataToArray Channel Number order 48 54 55.png

Adc_Sar_Ip_GetConvDataToArray Channel Number 55 54 48.png

So I think your test result should be:
adc1_result[0] stores the conversion result of p0_chanNum0
adc1_result[1] stores the conversion result of p1_chanNum1

It is recommended that you verify this in a non-debugging situation as well.


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
2 Replies
2,430 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Sorry, there is very little information about Adc_Sar_Ip_GetConvDataToArray, so I did a test: I adjusted the order of Adc Physical Channel Name in Channel configurations arry, but the order of ADC result did not change.

Adc_Sar_Ip_GetConvDataToArray Channel Number order 48 54 55.png

Adc_Sar_Ip_GetConvDataToArray Channel Number 55 54 48.png

So I think your test result should be:
adc1_result[0] stores the conversion result of p0_chanNum0
adc1_result[1] stores the conversion result of p1_chanNum1

It is recommended that you verify this in a non-debugging situation as well.


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
2,416 Views
fengba_360
Contributor III
My test results are the same as yours. thanks
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1951644%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Es32k312%20ADC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1951644%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%20I'm%20working%20with%20the%20ADC%20sampling%20function%20of%20the%20s32k312%20and%20I'm%20trying%20to%20understand%20how%20the%20values%20are%20stored%20in%20the%20adc1_result%5B%5D%20array%20when%20I%20call%20the%20function%20Adc_Sar_Ip_GetConvDataToArray(ADCHWUNIT_1_INSTANCE%2C%20ADC_SAR_IP_CONV_CHAIN_NORMAL%2C%20ADC1_CHANNEL_NUM%2C%20adc1_result)%3B%20to%20retrieve%20the%20ADC%20sampling%20results.%3C%2FP%3E%3CP%3ESpecifically%2C%20I%20want%20to%20know%20if%20the%20values%20in%20the%20adc1_result%5B%5D%20array%20are%20stored%20based%20on%20the%20configured%20channel%20numbers%20of%20ADC1%2C%20for%20example%3A%3C%2FP%3E%3CP%3Eadc1_result%5B0%5D%20stores%20the%20conversion%20result%20of%20p0_chanNum0%3CBR%20%2F%3Eadc1_result%5B1%5D%20stores%20the%20conversion%20result%20of%20p1_chanNum1%3CBR%20%2F%3EAnd%20so%20on%2C%20in%20a%20sequential%20manner.%3CBR%20%2F%3EOr%2C%20are%20they%20stored%20based%20on%20the%20actual%20ADC%20channel%20numbers%20and%20their%20corresponding%20positions%20in%20the%20ADC%20configuration%2C%20like%3A%3C%2FP%3E%3CP%3Eadc1_result%5B0%5D%20stores%20the%20conversion%20result%20of%20adcchannel0%20which%20might%20correspond%20to%20S19_ChanNum43%3CBR%20%2F%3Eadc1_result%5B1%5D%20stores%20the%20conversion%20result%20of%20adcchannel1%20which%20might%20correspond%20to%20S20_ChanNum44%3CBR%20%2F%3EAnd%20so%20forth.%3CBR%20%2F%3EI'm%20looking%20for%20clarification%20on%20how%20the%20results%20are%20mapped%20to%20the%20adc1_result%5B%5D%20array%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240911112743.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240911112743.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F298438i17BDA260BBB5593E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240911112743.png%22%20alt%3D%22%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240911112743.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1954106%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20s32k312%20ADC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1954106%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMy%20test%20results%20are%20the%20same%20as%20yours.%20thanks%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1953864%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20s32k312%20ADC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1953864%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3C%2FP%3E%0A%3CP%3ESorry%2C%20there%20is%20very%20little%20information%20about%20%3CSTRONG%3EAdc_Sar_Ip_GetConvDataToArray%3C%2FSTRONG%3E%2C%20so%20I%20did%20a%20test%3A%20I%20adjusted%20the%20order%20of%20%3CSTRONG%3EAdc%20Physical%20Channel%20Name%3C%2FSTRONG%3E%20in%20%3CSTRONG%3EChannel%20configurations%20arry%3C%2FSTRONG%3E%2C%20but%20the%20order%20of%20ADC%20result%20did%20not%20change.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Adc_Sar_Ip_GetConvDataToArray%20Channel%20Number%20order%2048%2054%2055.png%22%20style%3D%22width%3A%20843px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Adc_Sar_Ip_GetConvDataToArray%20Channel%20Number%20order%2048%2054%2055.png%22%20style%3D%22width%3A%20843px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F298955iC489E45A5A0C0065%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Adc_Sar_Ip_GetConvDataToArray%20Channel%20Number%20order%2048%2054%2055.png%22%20alt%3D%22Adc_Sar_Ip_GetConvDataToArray%20Channel%20Number%20order%2048%2054%2055.png%22%20%2F%3E%3C%2Fspan%3E%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%22Adc_Sar_Ip_GetConvDataToArray%20Channel%20Number%2055%2054%2048.png%22%20style%3D%22width%3A%20845px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Adc_Sar_Ip_GetConvDataToArray%20Channel%20Number%2055%2054%2048.png%22%20style%3D%22width%3A%20845px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F298952i425762CA04175BA4%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Adc_Sar_Ip_GetConvDataToArray%20Channel%20Number%2055%2054%2048.png%22%20alt%3D%22Adc_Sar_Ip_GetConvDataToArray%20Channel%20Number%2055%2054%2048.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ESo%20I%20think%20your%20test%20result%20should%20be%3A%3CBR%20%2F%3Eadc1_result%5B0%5D%20stores%20the%20conversion%20result%20of%20p0_chanNum0%3CBR%20%2F%3Eadc1_result%5B1%5D%20stores%20the%20conversion%20result%20of%20p1_chanNum1%3C%2FP%3E%0A%3CP%3EIt%20is%20recommended%20that%20you%20verify%20this%20in%20a%20non-debugging%20situation%20as%20well.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3ERobin%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3C%2FP%3E%0A%3CP%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E