s32k312 ADC

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

s32k312 ADC

Jump to solution
2,451 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,409 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,410 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,396 Views
fengba_360
Contributor III
My test results are the same as yours. thanks
0 Kudos
Reply