S32K118 ADC sample code

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

S32K118 ADC sample code

Jump to solution
2,051 Views
Pohsuan
Contributor III

Hello NXP team

I'm trying to use the ADC_pdb_IP_example_S32K118 project.

Pohsuan_0-1744791702071.png

I would like to use the S32 Configuration Tool to configure the ADC pin, but it seems not to be working, as shown in the image below.

Pohsuan_1-1744791898857.png

Could you please advise how I can properly use this sample code?

Thank you very much for your support.

Tags (1)
0 Kudos
Reply
1 Solution
2,029 Views
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

In ADC_pdb_IP_example_S32K118, the Pins Tool is disabled because this example do not use it, it use internal references only, please refer to description.txt file.

If you want to configure other pins, follow the following post:

https://community.nxp.com/t5/S32K/Issue-reading-EXT-ADC0-input-on-MRCANHUBK344-using-Adc-Sar-Btcu/td...

It is more or less the same procedure but instead of use Siul2 driver, it use Port driver.

Additionally please refer to other examples which use Pins Tool.

When debugging, you can see "data" value in "Expression" section. 

Hope it helps you.

Have a nice day!

View solution in original post

0 Kudos
Reply
3 Replies
2,030 Views
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

In ADC_pdb_IP_example_S32K118, the Pins Tool is disabled because this example do not use it, it use internal references only, please refer to description.txt file.

If you want to configure other pins, follow the following post:

https://community.nxp.com/t5/S32K/Issue-reading-EXT-ADC0-input-on-MRCANHUBK344-using-Adc-Sar-Btcu/td...

It is more or less the same procedure but instead of use Siul2 driver, it use Port driver.

Additionally please refer to other examples which use Pins Tool.

When debugging, you can see "data" value in "Expression" section. 

Hope it helps you.

Have a nice day!

0 Kudos
Reply
2,013 Views
Pohsuan
Contributor III

Hello Leo

Thanks for your reply 

I'm using PTA7 on the S32K118EVB as the external ADC channel.

I’m able to retrieve ADC values using software trigger with the function below.

Pohsuan_1-1744882136761.png

However, when using the hardware trigger part from the sample code, the program gets stuck in the while loop.

Pohsuan_3-1744882301351.png

Could you please provide any advice?
Or is there a hardware-triggered ADC sample I can refer to?

The attached archive contains the source code I’m currently using. Please refer to it.

Thank you

 

Tags (1)
0 Kudos
Reply
1,997 Views
_Leo_
NXP TechSupport
NXP TechSupport

Please help us creating a new post with these new questions. Thank you in advance for your understanding.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2081555%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K118%20ADC%20sample%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2081555%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20NXP%20team%3C%2FP%3E%3CP%3EI'm%20trying%20to%20use%20the%20%3CSTRONG%3EADC_pdb_IP_example_S32K118%3C%2FSTRONG%3E%20project.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Pohsuan_0-1744791702071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Pohsuan_0-1744791702071.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F333416i13D29214B3431BFA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Pohsuan_0-1744791702071.png%22%20alt%3D%22Pohsuan_0-1744791702071.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20would%20like%20to%20use%20the%20S32%20Configuration%20Tool%20to%20configure%20the%20ADC%20pin%2C%20but%20it%20seems%20not%20to%20be%20working%2C%20as%20shown%20in%20the%20image%20below.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Pohsuan_1-1744791898857.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Pohsuan_1-1744791898857.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F333419i01F08068EAEA5505%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Pohsuan_1-1744791898857.png%22%20alt%3D%22Pohsuan_1-1744791898857.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3ECould%20you%20please%20advise%20how%20I%20can%20properly%20use%20this%20sample%20code%3F%3C%2FP%3E%3CP%20class%3D%22%22%3EThank%20you%20very%20much%20for%20your%20support.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2082723%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K118%20ADC%20sample%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2082723%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPlease%20help%20us%20creating%20a%20new%20post%20with%20these%20new%20questions.%20Thank%20you%20in%20advance%20for%20your%20understanding.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2082470%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K118%20ADC%20sample%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2082470%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Leo%3C%2FP%3E%3CP%3EThanks%20for%20your%20reply%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20using%20%3CSTRONG%3EPTA7%20on%20the%20S32K118EVB%3C%2FSTRONG%3E%20as%20the%20external%20ADC%20channel.%3C%2FP%3E%3CP%3EI%E2%80%99m%20able%20to%20retrieve%20ADC%20values%20using%20%3CSTRONG%3Esoftware%20trigger%3C%2FSTRONG%3E%20with%20the%20function%20below.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Pohsuan_1-1744882136761.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Pohsuan_1-1744882136761.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F333660iE84C70D35D6E4066%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Pohsuan_1-1744882136761.png%22%20alt%3D%22Pohsuan_1-1744882136761.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHowever%2C%20when%20using%20the%20%3CSTRONG%3Ehardware%20trigger%3C%2FSTRONG%3E%20part%20from%20the%20sample%20code%2C%20the%20program%20gets%20stuck%20in%20the%20%3CSTRONG%3Ewhile%20loop%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Pohsuan_3-1744882301351.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Pohsuan_3-1744882301351.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F333662iE9A4C2E7125F4190%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Pohsuan_3-1744882301351.png%22%20alt%3D%22Pohsuan_3-1744882301351.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ECould%20you%20please%20provide%20any%20advice%3F%3CBR%20%2F%3EOr%20is%20there%20a%20%3CSTRONG%3Ehardware-triggered%20ADC%3C%2FSTRONG%3E%20sample%20I%20can%20refer%20to%3F%3C%2FP%3E%3CP%3EThe%20attached%20archive%20contains%20the%20source%20code%20I%E2%80%99m%20currently%20using.%20Please%20refer%20to%20it.%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2082005%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K118%20ADC%20sample%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2082005%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EThank%20you%20so%20much%20for%20your%20interest%20in%20our%20products%20and%20for%20using%20our%20community.%3C%2FP%3E%0A%3CP%3EIn%20%3CEM%3EADC_pdb_IP_example_S32K118%3C%2FEM%3E%2C%20the%20%3CEM%3EPins%20Tool%3C%2FEM%3E%20is%20disabled%20because%20this%20example%20do%20not%20use%20it%2C%20it%20use%20internal%20references%20only%2C%20please%20refer%20to%20%3CEM%3Edescription.txt%3C%2FEM%3E%20file.%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20configure%20other%20pins%2C%20follow%20the%20following%20post%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FIssue-reading-EXT-ADC0-input-on-MRCANHUBK344-using-Adc-Sar-Btcu%2Ftd-p%2F2076386%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FIssue-reading-EXT-ADC0-input-on-MRCANHUBK344-using-Adc-Sar-Btcu%2Ftd-p%2F2076386%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EIt%20is%20more%20or%20less%20the%20same%20procedure%20but%20instead%20of%20use%20%3CEM%3ESiul2%3C%2FEM%3E%20driver%2C%20it%20use%20%3CEM%3EPort%3C%2FEM%3E%20driver.%3C%2FP%3E%0A%3CP%3EAdditionally%20please%20refer%20to%20other%20examples%20which%20use%20%3CEM%3EPins%20Tool%3C%2FEM%3E.%3C%2FP%3E%0A%3CP%3EWhen%20debugging%2C%20you%20can%20see%20%22%3CEM%3Edata%3C%2FEM%3E%22%20value%20in%20%22%3CEM%3EExpression%3C%2FEM%3E%22%20section.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHope%20it%20helps%20you.%3C%2FP%3E%0A%3CP%3EHave%20a%20nice%20day!%3C%2FP%3E%3C%2FLINGO-BODY%3E