Changing ADC S32K342 to read from pin instead of internal bandgap

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

Changing ADC S32K342 to read from pin instead of internal bandgap

Jump to solution
1,453 Views
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 Kudos
Reply
1 Solution
1,227 Views
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.

View solution in original post

0 Kudos
Reply
5 Replies
1,433 Views
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 Kudos
Reply
1,425 Views
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 Kudos
Reply
1,387 Views
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 Kudos
Reply
1,358 Views
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 Kudos
Reply
1,228 Views
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 Kudos
Reply