s32k312 ADC

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

s32k312 ADC

跳至解决方案
2,444 次查看
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,402 次查看
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,403 次查看
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,389 次查看
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%E6%82%A8%E5%A5%BD%EF%BC%8C%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20s32k312%20%E7%9A%84%20ADC%20%E9%87%87%E6%A0%B7%E5%8A%9F%E8%83%BD%EF%BC%8C%E5%B9%B6%E4%B8%94%E6%88%91%E8%AF%95%E5%9B%BE%E4%BA%86%E8%A7%A3%E5%BD%93%E6%88%91%E8%B0%83%E7%94%A8%E5%87%BD%E6%95%B0%20Adc_Sar_Ip_GetConvDataToArray(ADCHWUNIT_1_INSTANCE%2C%20ADC_SAR_IP_CONV_CHAIN_NORMAL%2C%20ADC1_CHANNEL_NUM%2C%20adc1_result)%3B%20%E6%9D%A5%E6%A3%80%E7%B4%A2%20ADC%20%E9%87%87%E6%A0%B7%E7%BB%93%E6%9E%9C%E6%97%B6%EF%BC%8C%E5%80%BC%E6%98%AF%E5%A6%82%E4%BD%95%E5%AD%98%E5%82%A8%E5%9C%A8%20adc1_result%5B%5D%20%E6%95%B0%E7%BB%84%E4%B8%AD%E7%9A%84%E3%80%82%3C%2FP%3E%3CP%3E%E5%85%B7%E4%BD%93%E6%9D%A5%E8%AF%B4%EF%BC%8C%E6%88%91%E6%83%B3%E7%9F%A5%E9%81%93%20adc1_result%5B%5D%20%E6%95%B0%E7%BB%84%E4%B8%AD%E7%9A%84%E5%80%BC%E6%98%AF%E5%90%A6%E6%A0%B9%E6%8D%AE%20ADC1%20%E7%9A%84%E9%85%8D%E7%BD%AE%E9%80%9A%E9%81%93%E5%8F%B7%E5%AD%98%E5%82%A8%EF%BC%8C%E4%BE%8B%E5%A6%82%EF%BC%9A%3C%2FP%3E%3CP%3Eadc1_result%5B0%5D%E5%AD%98%E5%82%A8p0_chanNum0%E7%9A%84%E8%BD%AC%E6%8D%A2%E7%BB%93%E6%9E%9C%3CBR%20%2F%3Eadc1_result%5B1%5D%E5%AD%98%E5%82%A8p1_chanNum1%E7%9A%84%E8%BD%AC%E6%8D%A2%E7%BB%93%E6%9E%9C%3CBR%20%2F%3E%E4%BE%9D%E6%AD%A4%E7%B1%BB%E6%8E%A8%EF%BC%8C%E4%BB%A5%E9%A1%BA%E5%BA%8F%E6%96%B9%E5%BC%8F%E8%BF%9B%E8%A1%8C%E3%80%82%3CBR%20%2F%3E%E6%88%96%E8%80%85%EF%BC%8C%E5%AE%83%E4%BB%AC%E6%98%AF%E5%90%A6%E6%A0%B9%E6%8D%AE%E5%AE%9E%E9%99%85%20ADC%20%E9%80%9A%E9%81%93%E5%8F%B7%E5%8F%8A%E5%85%B6%E5%9C%A8%20ADC%20%E9%85%8D%E7%BD%AE%E4%B8%AD%E7%9A%84%E5%AF%B9%E5%BA%94%E4%BD%8D%E7%BD%AE%E8%BF%9B%E8%A1%8C%E5%AD%98%E5%82%A8%EF%BC%8C%E4%BE%8B%E5%A6%82%EF%BC%9A%3C%2FP%3E%3CP%3Eadc1_result%5B0%5D%E5%AD%98%E5%82%A8adcchannel0%E7%9A%84%E8%BD%AC%E6%8D%A2%E7%BB%93%E6%9E%9C%EF%BC%8C%E5%8F%AF%E8%83%BD%E5%AF%B9%E5%BA%94S19_ChanNum43%3CBR%20%2F%3E%20adc1_result%5B1%5D%E5%AD%98%E5%82%A8adcchannel1%E7%9A%84%E8%BD%AC%E6%8D%A2%E7%BB%93%E6%9E%9C%EF%BC%8C%E5%8F%AF%E8%83%BD%E5%AF%B9%E5%BA%94S20_ChanNum44%3CBR%20%2F%3E%E7%AD%89%E7%AD%89%E3%80%82%3CBR%20%2F%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E5%AF%BB%E6%89%BE%E6%9C%89%E5%85%B3%E5%A6%82%E4%BD%95%E5%B0%86%E7%BB%93%E6%9E%9C%E6%98%A0%E5%B0%84%E5%88%B0%20adc1_result%5B%5D%20%E6%95%B0%E7%BB%84%E7%9A%84%E8%AF%B4%E6%98%8E%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%E6%88%91%E7%9A%84%E6%B5%8B%E8%AF%95%E7%BB%93%E6%9E%9C%E5%92%8C%E4%BD%A0%E7%9A%84%E4%B8%80%E6%A0%B7%E3%80%82%E8%B0%A2%E8%B0%A2%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%E6%8A%B1%E6%AD%89%EF%BC%8C%E5%85%B3%E4%BA%8E%3CSTRONG%3EAdc_Sar_Ip_GetConvDataToArray%3C%2FSTRONG%3E%E7%9A%84%E4%BF%A1%E6%81%AF%E5%BE%88%E5%B0%91%EF%BC%8C%E6%89%80%E4%BB%A5%E6%88%91%E5%81%9A%E4%BA%86%E4%B8%80%E4%B8%AA%E6%B5%8B%E8%AF%95%EF%BC%9A%E6%88%91%E8%B0%83%E6%95%B4%E4%BA%86%3CSTRONG%3EChannel%20configurations%20arry%3C%2FSTRONG%3E%E4%B8%AD%3CSTRONG%3EAdc%20Physical%20Channel%20Name%3C%2FSTRONG%3E%E7%9A%84%E9%A1%BA%E5%BA%8F%EF%BC%8C%E4%BD%86%E6%98%AF%20ADC%20%E7%BB%93%E6%9E%9C%E7%9A%84%E9%A1%BA%E5%BA%8F%E6%B2%A1%E6%9C%89%E6%94%B9%E5%8F%98%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%E6%89%80%E4%BB%A5%E6%88%91%E8%AE%A4%E4%B8%BA%E4%BD%A0%E7%9A%84%E6%B5%8B%E8%AF%95%E7%BB%93%E6%9E%9C%E5%BA%94%E8%AF%A5%E6%98%AF%EF%BC%9A%3CBR%20%2F%3E%20adc1_result%5B0%5D%E5%AD%98%E5%82%A8p0_chanNum0%E7%9A%84%E8%BD%AC%E6%8D%A2%E7%BB%93%E6%9E%9C%3CBR%20%2F%3Eadc1_result%5B1%5D%E5%AD%98%E5%82%A8p1_chanNum1%E7%9A%84%E8%BD%AC%E6%8D%A2%E7%BB%93%E6%9E%9C%3C%2FP%3E%0A%3CP%3E%E5%BB%BA%E8%AE%AE%E6%82%A8%E5%9C%A8%E9%9D%9E%E8%B0%83%E8%AF%95%E6%83%85%E5%86%B5%E4%B8%8B%E4%B9%9F%E9%AA%8C%E8%AF%81%E8%BF%99%E4%B8%80%E7%82%B9%E3%80%82%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%E6%AD%A4%E8%87%B4%EF%BC%8C%3CBR%20%2F%3E%E7%BD%97%E5%AE%BE%3CBR%20%2F%3E--------------------------------------------------------------------------------%3CBR%20%2F%3E%E7%AC%94%E8%AE%B0%EF%BC%9A%3CBR%20%2F%3E%20-%20%E5%A6%82%E6%9E%9C%E8%BF%99%E7%AF%87%E6%96%87%E7%AB%A0%E5%9B%9E%E7%AD%94%E4%BA%86%E6%82%A8%E7%9A%84%E9%97%AE%E9%A2%98%EF%BC%8C%E8%AF%B7%E7%82%B9%E5%87%BB%E2%80%9C%E6%A0%87%E8%AE%B0%E6%AD%A3%E7%A1%AE%E2%80%9D%E6%8C%89%E9%92%AE%E3%80%82%E8%B0%A2%E8%B0%A2%E4%BD%A0%EF%BC%81%3C%2FP%3E%0A%3CP%3E-%20%E6%88%91%E4%BB%AC%E4%BC%9A%E5%85%B3%E6%B3%A8%E4%B8%8A%E6%AC%A1%E5%8F%91%E5%B8%96%E5%90%8E%E4%B8%83%E5%91%A8%E7%9A%84%E5%B8%96%E5%AD%90%EF%BC%8C%E4%B9%8B%E5%90%8E%E7%9A%84%E5%9B%9E%E5%A4%8D%E5%B0%86%E8%A2%AB%E5%BF%BD%E7%95%A5%3CBR%20%2F%3E%E5%A6%82%E6%9E%9C%E6%82%A8%E7%A8%8D%E5%90%8E%E6%9C%89%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%EF%BC%8C%E8%AF%B7%E6%89%93%E5%BC%80%E4%B8%80%E4%B8%AA%E6%96%B0%E7%BA%BF%E7%A8%8B%E5%B9%B6%E5%8F%82%E8%80%83%E5%B7%B2%E5%85%B3%E9%97%AD%E7%9A%84%E7%BA%BF%E7%A8%8B%E3%80%82%3CBR%20%2F%3E--------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E