ACD example to read voltage

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

ACD example to read voltage

Jump to solution
934 Views
jetty_1012
Contributor II

I'm using S32K312. I need an ACD example to read voltage.

 

Thanks.

0 Kudos
Reply
1 Solution
898 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Have you test Adc_Sar_Bctu_Ip_example_S32K312 in S32K3 RTD? Which ADC channel do you want to sample? Please select Adc Physical Channel Name in S32CT.

You can also refer to the Example-S32K3 Temperature Sensor S32 DS V3.5 + RTD 2.0.2


Best Regards,
Robin

View solution in original post

0 Kudos
Reply
4 Replies
911 Views
jetty_1012
Contributor II

jetty_1012_0-1691065105819.jpeg

Is Adc_Sar_Ip_GetConvData used for reading ADC?

That was my testing code and I was debugging. The return value of this API was 0. How should I read ADC value correctly?

0 Kudos
Reply
899 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Have you test Adc_Sar_Bctu_Ip_example_S32K312 in S32K3 RTD? Which ADC channel do you want to sample? Please select Adc Physical Channel Name in S32CT.

You can also refer to the Example-S32K3 Temperature Sensor S32 DS V3.5 + RTD 2.0.2


Best Regards,
Robin

0 Kudos
Reply
883 Views
jetty_1012
Contributor II

@Robin_Shen Thanks for you reply.

I referred to the example and just reconfigured it.

jetty_1012_0-1691118727276.jpeg

At first, I had no clue how to set the second parameter of Adc_Sar_Ip_GetConvData, so it only returned 0.

And now I know how to set it based on different channles and I can read specific values from it, but the values I read are usually over 4095.

Precise ADC is 12-bit binary number which is 4095 at max.

Why is it over 4095? Is there any conversion about it?

Thanks.

0 Kudos
Reply
868 Views
jetty_1012
Contributor II
Well, I figured it out. There's a Conversion resolution option which was set to 14 before. I change it to 12 and the ADC values are below 4095 now.
0 Kudos
Reply