s32k312 ADC

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,446件の閲覧回数
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 件の賞賛
返信
1 解決策
2,404件の閲覧回数
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 件の賞賛
返信
2 返答(返信)
2,405件の閲覧回数
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 件の賞賛
返信
2,391件の閲覧回数
fengba_360
Contributor III
My test results are the same as yours. thanks
0 件の賞賛
返信
%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%3E%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%E7%A7%81%E3%81%AFs32k312%E3%81%AEADC%E3%82%B5%E3%83%B3%E3%83%97%E3%83%AA%E3%83%B3%E3%82%B0%E9%96%A2%E6%95%B0%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%8A%E3%82%8A%E3%80%81%E9%96%A2%E6%95%B0%E3%82%92%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%99%E3%81%A8%E3%81%8D%E3%81%AB%E5%80%A4%E3%81%8Cadc1_result%5B%5D%E9%85%8D%E5%88%97%E3%81%AB%E3%81%A9%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E6%A0%BC%E7%B4%8D%E3%81%95%E3%82%8C%E3%82%8B%E3%81%8B%E3%82%92%E7%90%86%E8%A7%A3%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99Adc_Sar_Ip_GetConvDataToArray(ADCHWUNIT_1_INSTANCE%E3%80%81ADC_SAR_IP_CONV_CHAIN_NORMAL%E3%80%81ADC1_CHANNEL_NUM%E3%80%81adc1_result)%3B%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%97%E3%81%A6%E3%80%81ADC%20%E3%81%AE%E3%82%B5%E3%83%B3%E3%83%97%E3%83%AA%E3%83%B3%E3%82%B0%E7%B5%90%E6%9E%9C%E3%82%92%E5%8F%96%E5%BE%97%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E5%85%B7%E4%BD%93%E7%9A%84%E3%81%AB%E3%81%AF%E3%80%81adc1_result%5B%5D%E9%85%8D%E5%88%97%E3%81%AE%E5%80%A4%E3%81%8CADC1%E3%81%AE%E6%A7%8B%E6%88%90%E6%B8%88%E3%81%BF%E3%83%81%E3%83%A3%E3%83%8D%E3%83%AB%E7%95%AA%E5%8F%B7%E3%81%AB%E5%9F%BA%E3%81%A5%E3%81%84%E3%81%A6%E6%A0%BC%E7%B4%8D%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E3%81%8B%E3%81%A9%E3%81%86%E3%81%8B%E3%82%92%E7%9F%A5%E3%82%8A%E3%81%9F%E3%81%84%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3Eadc1_result%5B0%5D%E3%81%AFp0_chanNum0%E3%81%AE%E5%A4%89%E6%8F%9B%E7%B5%90%E6%9E%9C%E3%82%92%E6%A0%BC%E7%B4%8D%E3%81%97%E3%81%BE%E3%81%99%3CBR%20%2F%3Eadc1_result%5B1%5D%E3%81%AFp1_chanNum1%E3%81%AE%E5%A4%89%E6%8F%9B%E7%B5%90%E6%9E%9C%E3%82%92%E6%A0%BC%E7%B4%8D%E3%81%97%E3%81%BE%E3%81%99%3CBR%20%2F%3E%E3%81%AA%E3%81%A9%E3%80%81%E9%A0%86%E6%AC%A1%E8%A1%8C%E3%82%8F%E3%82%8C%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%E3%81%BE%E3%81%9F%E3%81%AF%E3%80%81%E6%AC%A1%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E3%80%81%E5%AE%9F%E9%9A%9B%E3%81%AEADC%E3%83%81%E3%83%A3%E3%83%8D%E3%83%AB%E7%95%AA%E5%8F%B7%E3%81%A8ADC%E6%A7%8B%E6%88%90%E5%86%85%E3%81%AE%E5%AF%BE%E5%BF%9C%E3%81%99%E3%82%8B%E4%BD%8D%E7%BD%AE%E3%81%AB%E5%9F%BA%E3%81%A5%E3%81%84%E3%81%A6%E4%BF%9D%E5%AD%98%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%E3%81%8B%E3%80%82%3C%2FP%3E%3CP%3Eadc1_result%5B0%5D%20%E3%81%AF%E3%80%81%20S19_ChanNum43%20adcchannel0%20%E3%81%AE%E5%A4%89%E6%8F%9B%E7%B5%90%E6%9E%9C%E3%82%92%E6%A0%BC%E7%B4%8D%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81%3CBR%20%2F%3Eadc1_result%5B1%5D%20%E3%81%AF%E3%80%81%20adcchannel1%20%E3%81%AE%E5%A4%89%E6%8F%9B%E7%B5%90%E6%9E%9C%E3%82%92%E6%A0%BC%E7%B4%8D%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%AF%20adcchannel1%20%E3%81%AB%E5%AF%BE%E5%BF%9C%E3%81%97%E3%81%BE%E3%81%99S20_ChanNum44%3CBR%20%2F%3E%E7%AD%89%E3%80%85%E3%80%82%3CBR%20%2F%3E%E7%A7%81%E3%81%AF%E3%80%81%E7%B5%90%E6%9E%9C%E3%81%8Cadc1_result%5B%5D%E9%85%8D%E5%88%97%E3%81%AB%E3%81%A9%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E3%83%9E%E3%83%83%E3%83%94%E3%83%B3%E3%82%B0%E3%81%95%E3%82%8C%E3%82%8B%E3%81%8B%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6%E3%81%AE%E6%98%8E%E7%A2%BA%E5%8C%96%E3%82%92%E6%B1%82%E3%82%81%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%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%3E%E7%A7%81%E3%81%AE%E3%83%86%E3%82%B9%E3%83%88%E7%B5%90%E6%9E%9C%E3%81%AF%E3%81%82%E3%81%AA%E3%81%9F%E3%81%AE%E3%82%82%E3%81%AE%E3%81%A8%E5%90%8C%E3%81%98%E3%81%A7%E3%81%99%E3%80%82%E6%84%9F%E8%AC%9D%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%3E%E7%94%B3%E3%81%97%E8%A8%B3%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%81%8C%E3%80%81%3CSTRONG%3EAdc_Sar_Ip_GetConvDataToArray%3C%2FSTRONG%3E%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E6%83%85%E5%A0%B1%E3%81%8C%E3%81%BB%E3%81%A8%E3%82%93%E3%81%A9%E3%81%AA%E3%81%84%E3%81%9F%E3%82%81%E3%80%81%E3%83%86%E3%82%B9%E3%83%88%E3%82%92%E8%A1%8C%E3%81%84%E3%81%BE%E3%81%97%E3%81%9F%3A%3CSTRONG%3E%E3%83%81%E3%83%A3%E3%83%8D%E3%83%AB%E6%A7%8B%E6%88%90arry%3C%2FSTRONG%3E%E3%81%A7%3CSTRONG%3EADC%E7%89%A9%E7%90%86%E3%83%81%E3%83%A3%E3%83%8D%E3%83%AB%E5%90%8D%3C%2FSTRONG%3E%E3%81%AE%E9%A0%86%E5%BA%8F%E3%82%92%E8%AA%BF%E6%95%B4%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%81%8C%E3%80%81ADC%E3%81%AE%E7%B5%90%E6%9E%9C%E3%81%AE%E9%A0%86%E5%BA%8F%E3%81%AF%E5%A4%89%E3%82%8F%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%81%A7%E3%81%97%E3%81%9F%E3%80%82%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%3E%E3%81%97%E3%81%9F%E3%81%8C%E3%81%A3%E3%81%A6%E3%80%81%E3%83%86%E3%82%B9%E3%83%88%E7%B5%90%E6%9E%9C%E3%81%AF%E6%AC%A1%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E3%81%AA%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3Eadc1_result%5B0%5D%E3%81%AFp0_chanNum0%E3%81%AE%E5%A4%89%E6%8F%9B%E7%B5%90%E6%9E%9C%E3%82%92%E6%A0%BC%E7%B4%8D%E3%81%97%E3%81%BE%E3%81%99%3CBR%20%2F%3Eadc1_result%5B1%5D%E3%81%AFp1_chanNum1%E3%81%AE%E5%A4%89%E6%8F%9B%E7%B5%90%E6%9E%9C%E3%82%92%E6%A0%BC%E7%B4%8D%E3%81%97%E3%81%BE%E3%81%99%3C%2FP%3E%0A%3CP%3E%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E4%BB%A5%E5%A4%96%E3%81%AE%E7%8A%B6%E6%B3%81%E3%81%A7%E3%82%82%E7%A2%BA%E8%AA%8D%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%82%92%E3%81%8A%E5%8B%A7%E3%82%81%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%E3%82%88%E3%82%8D%E3%81%97%E3%81%8F%E3%81%8A%E9%A1%98%E3%81%84%E3%81%84%E3%81%9F%E3%81%97%E3%81%BE%E3%81%99%3CBR%20%2F%3E%E3%83%AD%E3%83%93%E3%83%B3%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3E%E6%89%8B%E8%A8%98%EF%BC%9A%3CBR%20%2F%3E-%20%E3%81%93%E3%81%AE%E8%A8%98%E4%BA%8B%E3%81%8C%E3%81%82%E3%81%AA%E3%81%9F%E3%81%AE%E7%96%91%E5%95%8F%E3%81%AB%E7%AD%94%E3%81%88%E3%81%9F%E3%82%89%E3%80%81%E3%80%8C%E6%AD%A3%E8%A7%A3%E3%82%92%E3%83%9E%E3%83%BC%E3%82%AF%E3%80%8D%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%E3%81%94%E3%81%96%E3%81%84%E3%81%BE%E3%81%99%EF%BC%81%3C%2FP%3E%0A%3CP%3E-%20%E6%9C%80%E5%BE%8C%E3%81%AE%E6%8A%95%E7%A8%BF%E3%81%8B%E3%82%897%E9%80%B1%E9%96%93%E3%82%B9%E3%83%AC%E3%83%83%E3%83%89%E3%82%92%E3%83%95%E3%82%A9%E3%83%AD%E3%83%BC%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E3%81%9D%E3%81%AE%E5%BE%8C%E3%81%AE%E8%BF%94%E4%BF%A1%E3%81%AF%E7%84%A1%E8%A6%96%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%3CBR%20%2F%3E%E6%96%B0%E3%81%97%E3%81%84%E3%82%B9%E3%83%AC%E3%83%83%E3%83%89%E3%82%92%E9%96%8B%E3%81%8D%E3%80%81%E5%BE%8C%E3%81%A7%E9%96%A2%E9%80%A3%E3%81%99%E3%82%8B%E8%B3%AA%E5%95%8F%E3%81%8C%E3%81%82%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AF%E3%80%81%E9%96%89%E3%81%98%E3%81%9F%E3%82%B9%E3%83%AC%E3%83%83%E3%83%89%E3%82%92%E5%8F%82%E7%85%A7%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E