Issue with Reading 12-bit ADC Values on S32K312

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Issue with Reading 12-bit ADC Values on S32K312

ソリューションへジャンプ
652件の閲覧回数
selvarajasekar
Contributor III

I am using S32 Design Studio 3.4 along with example projects from S32K3 RTD AUTOSAR 4.4.2.0.0 D2203. Specifically, I am working with the Adc_sar_Bctu_ip_example_s32k312 project.

I have configured the ADC channels, but I am encountering an issue where the ADC value ranges from 0 to 227 (min to max). I need the ADC value to range from 0 to 4096, which corresponds to the full 12-bit resolution.

I have attempted to change the configuration settings, but the problem persists. I will attach the configuration I have done in S32 Design Studio.

Could you please assist me in resolving this issue? I look forward to your prompt response.

I have attached the platform_io.c ,kindly check the line from 1026 to 1078.(ADC PART).
1.png2.png3.png4.png5.png6.png7.png

0 件の賞賛
返信
1 解決策
547件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you have some divider on inputs, so you do not get full scale assuming Vref is at 5V too.
However as I wrote, an issue could be you did not perform ADC calibration before conversion. Check behavior when you do it.
If have issue still, share simplified project so we can test on EVB, or refer to RTD demo example.

BR, Petr

元の投稿で解決策を見る

0 件の賞賛
返信
6 返答(返信)
608件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the setting looks normal. For a code you would perform ADC calibration (Adc_Sar_Ip_DoCalibration) after ADC init and before conversion is initialized.
What do you have connected to precise channels, which are selected to be converted using normal chain? How are MCU pins configured?
Is a BCTU conversion also triggered? And what is a result from that?

BR, Petr

0 件の賞賛
返信
590件の閲覧回数
selvarajasekar
Contributor III

Hi,
I'm seeking a straightforward method to obtain a 12-bit ADC reading from the ADC pin, with the  BCTU conversion has been triggered in my code. I've provided a code reference and an image detailing the MCU pin configuration for your convenience.

0 件の賞賛
返信
576件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

please specify measured voltage on ADC_INx pins and obtained values in ADC_Result buffer.

BR, Petr

0 件の賞賛
返信
569件の閲覧回数
selvarajasekar
Contributor III

Hi Petrs,
The measured voltage at ADC_IN5, ADC_IN6, and ADC_IN7 is 5 volts, and the values in the ADC_Result buffer range from a minimum of 27 to a maximum of 168.

0 件の賞賛
返信
548件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you have some divider on inputs, so you do not get full scale assuming Vref is at 5V too.
However as I wrote, an issue could be you did not perform ADC calibration before conversion. Check behavior when you do it.
If have issue still, share simplified project so we can test on EVB, or refer to RTD demo example.

BR, Petr

0 件の賞賛
返信
373件の閲覧回数
selvarajasekar
Contributor III
driver is not updating, we need to change the resolution manually
0 件の賞賛
返信