Changing ADC S32K342 to read from pin instead of internal bandgap

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

Changing ADC S32K342 to read from pin instead of internal bandgap

跳至解决方案
1,454 次查看
pb632146
Contributor V

I am trying to edit the Adc_Sar_Bctu_Ip_example_S32K344 example to read from an input pin, in this case Pin78 on the 100 pin package which corresponds to S9, rather than the internal bandgap. Is changing the ADC Physical Channel name to S9 and the define to match the correct channel number? When I try to run it it gets stuck in the endofchainnotif with data having the maxed out 14 bit value despite not having any power connected to the pin

pb632146_1-1726794427802.png

 

pb632146_0-1726794347091.png

 

pb632146_3-1726794652940.png

 

 

Is there an easier/barebones way to do this?

0 项奖励
回复
1 解答
1,228 次查看
pb632146
Contributor V
While I still dont get the data value to appear in variables on the right the issue was found to be a hardware one and now the adc functions properly.

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,434 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

changes you did would be enough. Even not connected external signal you will get some value converted. Put some voltage and check if you got correct conversion.
You can omit while loop in notification callback, it is there just for example purpose. Do your stuff with converted value.

BR, Petr

0 项奖励
回复
1,426 次查看
pb632146
Contributor V

It never shows me a conversion, in variables all I have are these optimized out values, am I looking in the wrong place? Regardless of whether I give S9 voltage or not the data only shows 16838 if i hover it

 

pb632146_0-1726835735926.png

 

0 项奖励
回复
1,388 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I tried this example on S32K344_EVB, do little code modification to do SW trigger still, connect POT output to S9 channel and see conversion normally changing as per input value.

PetrS_0-1727097966857.png

BR, Petr

0 项奖励
回复
1,359 次查看
pb632146
Contributor V

I tried to copy this and it still does not show on the variables/ data goes maximum 14 bit value. I attached the project to maybe help. My board is just an s32k342 with the bare minimum requirements to power on the board. Also for some reason in the 342 SDK VS_0 is named Board_peripherals according to a different post which is why that is different to the 344 version.

also the 

pb632146_0-1727137659721.png

pb632146_2-1727137714276.png

 

0 项奖励
回复
1,229 次查看
pb632146
Contributor V
While I still dont get the data value to appear in variables on the right the issue was found to be a hardware one and now the adc functions properly.
0 项奖励
回复