s32k311 adc

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

s32k311 adc

2,110 Views
piyush1
Contributor III

i am new to this NXP s32k3 and i am working with NXP s32k311 mcu .....i want to configure ADC of s32k311 but i don't know how to start ......please share me some resources and also provide ADC LLD (non-autosar)  drivers training module so that i can get to know how to use APIs and which APIs to call....provide me every resource of ADC so that i can configure it by myself.

0 Kudos
Reply
5 Replies

2,093 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

unfortunately the RTD installation does not contain demo examples specifically for the S32K311, but there are demos for other derivatives that can serve as useful references. The recommended approach is to create a new project, perform manual configuration, and copy the relevant code.

Some ADC training material is available on https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/S32K/46171/1/S32K3_RTD_Training_ADC_BCTU..., but good explanation of ADC usage with various triggering concepts is also given on 
https://community.nxp.com/t5/S32K-Knowledge-Base/RTD400-LLD-K344-ADC-SW-HW-trigger/ta-p/1966179
Again is is for S32K344 but you can reuse principles/configurations in your new created project for S32K311

BR, Petr

0 Kudos
Reply

2,015 Views
piyush1
Contributor III

hello brother......how can i configure multi channel ADC continues mode? help me out

0 Kudos
Reply

1,959 Views
PavelL
NXP Employee
NXP Employee

Hello @piyush1 ,

To configure multi-channel ADC in continuous mode:

  • Use ADC0 or ADC1 and configure multiple channels in the ADC_ConfigType structure.
  • Set the conversion mode to ADC_CONV_MODE_CONTINUOUS.
  • Use BCTU (Background Conversion Trigger Unit) if you want to automate channel switching.
  • Ensure that TRGMUX is properly configured to trigger ADC conversions.

You can refer to the training PDF above for BCTU setup and channel chaining.

Best regards,

Pavel

0 Kudos
Reply

2,004 Views
piyush1
Contributor III

piyush1_0-1754137605673.png

In s32k311 mcu the adc clock is 120 MHZ here ...and according S32K3_RTD_Training_ADC_BCTU_TRGMUX.pdf the adc conversion clock is 80 MHZ

piyush1_1-1754137803913.png

so i didn't understand this explain me about this

0 Kudos
Reply

1,958 Views
PavelL
NXP Employee
NXP Employee

Hello @piyush1 ,

The ADC module in S32K311 receives its input clock from CORE_CLK, which can be up to 120 MHz depending on your system configuration. However, the ADC uses an internal conversion clock, which is derived by dividing the input clock using the ADC.MCR[ADCLKSEL] setting:

  • ADCLKSEL = 00 → divide by 1
  • ADCLKSEL = 01 → divide by 2
  • ADCLKSEL = 10 → divide by 4

All internal ADC timing - including sampling and conversion - is based on this divided clock. The conversion time itself is not configurable directly; it depends on resolution and averaging settings. You may refer to an explanation in this article  S32K312 ADC Clock Selection

Best regards,

Pavel

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2141453%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Es32k311%20adc%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2141453%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ei%20am%20new%20to%20this%20NXP%20s32k3%20and%20i%20am%20working%20with%20NXP%20s32k311%20mcu%20.....i%20want%20to%20configure%20ADC%20of%20s32k311%20but%20i%20don't%20know%20how%20to%20start%20......please%20share%20me%20some%20resources%20and%20also%20provide%20ADC%20LLD%20(non-autosar)%26nbsp%3B%20drivers%20training%20module%20so%20that%20i%20can%20get%20to%20know%20how%20to%20use%20APIs%20and%20which%20APIs%20to%20call....provide%20me%20every%20resource%20of%20ADC%20so%20that%20i%20can%20configure%20it%20by%20myself.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2146221%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k311%20adc%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2146221%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F252587%22%20target%3D%22_blank%22%3E%40piyush1%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EThe%20ADC%20module%20in%20S32K311%20receives%20its%20input%20clock%20from%26nbsp%3BCORE_CLK%2C%20which%20can%20be%20up%20to%20120%20MHz%20depending%20on%20your%20system%20configuration.%20However%2C%20the%20ADC%20uses%20an%20internal%26nbsp%3Bconversion%20clock%2C%20which%20is%20derived%20by%20dividing%20the%20input%20clock%20using%20the%26nbsp%3BADC.MCR%5BADCLKSEL%5D%26nbsp%3Bsetting%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EADCLKSEL%20%3D%2000%26nbsp%3B%E2%86%92%20divide%20by%201%3C%2FLI%3E%0A%3CLI%3EADCLKSEL%20%3D%2001%26nbsp%3B%E2%86%92%20divide%20by%202%3C%2FLI%3E%0A%3CLI%3EADCLKSEL%20%3D%2010%26nbsp%3B%E2%86%92%20divide%20by%204%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EAll%20internal%20ADC%20timing%20-%20including%20sampling%20and%20conversion%20-%20is%20based%20on%20this%20divided%20clock.%20The%20conversion%20time%20itself%20is%20not%20configurable%20directly%3B%20it%20depends%20on%20resolution%20and%20averaging%20settings.%20You%20may%20refer%20to%20an%20explanation%20in%20this%20article%26nbsp%3B%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20class%3D%22fui-Link%20___w5et180%20f2hkw1w%20f3rmtva%20f1ewtqcl%20fyind8e%20f1k6fduh%20f1w7gpdv%20f1mo0ibp%20fjoy568%20ff5ikls%20f1s184ao%20f1mk8lai%20fnbmjn9%20f1o700av%20f13mvf36%20f1cmlufx%20f9n3di6%20f1ids18y%20f1tx3yz7%20f1deo86v%20f1eh06m1%20f1iescvh%20fhgqx19%20f1olyrje%20f1p93eir%20f1nev41a%22%20tabindex%3D%220%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FS32K312-ADC-Clock-selection%2Fta-p%2F1997759%22%20target%3D%22_blank%22%20data-tabster%3D%22%7B%22%20restorer%3D%22%22%3ES32K312%20ADC%20Clock%20Selection%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPavel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2146216%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k311%20adc%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2146216%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F252587%22%20target%3D%22_blank%22%3E%40piyush1%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3ETo%20configure%20multi-channel%20ADC%20in%20continuous%20mode%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EUse%26nbsp%3BADC0%26nbsp%3Bor%26nbsp%3BADC1%26nbsp%3Band%20configure%20multiple%20channels%20in%20the%26nbsp%3BADC_ConfigType%26nbsp%3Bstructure.%3C%2FLI%3E%0A%3CLI%3ESet%20the%26nbsp%3Bconversion%20mode%26nbsp%3Bto%26nbsp%3BADC_CONV_MODE_CONTINUOUS.%3C%2FLI%3E%0A%3CLI%3EUse%26nbsp%3BBCTU%26nbsp%3B(Background%20Conversion%20Trigger%20Unit)%20if%20you%20want%20to%20automate%20channel%20switching.%3C%2FLI%3E%0A%3CLI%3EEnsure%20that%26nbsp%3BTRGMUX%26nbsp%3Bis%20properly%20configured%20to%20trigger%20ADC%20conversions.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EYou%20can%20refer%20to%20the%20training%20PDF%20above%20for%20BCTU%20setup%20and%20channel%20chaining.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPavel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2145661%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k311%20adc%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2145661%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22piyush1_0-1754137605673.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22piyush1_0-1754137605673.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F350690iEA903213468535BC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22piyush1_0-1754137605673.png%22%20alt%3D%22piyush1_0-1754137605673.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIn%20s32k311%20mcu%20the%20adc%20clock%20is%20120%20MHZ%20here%20...and%20according%26nbsp%3BS32K3_RTD_Training_ADC_BCTU_TRGMUX.pdf%20the%20adc%20conversion%20clock%20is%2080%20MHZ%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22piyush1_1-1754137803913.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22piyush1_1-1754137803913.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F350691i0E6BBFC8C6BC8B3A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22piyush1_1-1754137803913.png%22%20alt%3D%22piyush1_1-1754137803913.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Eso%20i%20didn't%20understand%20this%20explain%20me%20about%20this%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2145170%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k311%20adc%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2145170%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ehello%20brother......how%20can%20i%20configure%20multi%20channel%20ADC%20continues%20mode%3F%20help%20me%20out%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2141753%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k311%20adc%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2141753%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Eunfortunately%20the%20RTD%20installation%20does%20not%20contain%20demo%20examples%20specifically%20for%20the%20S32K311%2C%20but%20there%20are%20demos%20for%20other%20derivatives%20that%20can%20serve%20as%20useful%20references.%20The%20recommended%20approach%20is%20to%20create%20a%20new%20project%2C%20perform%20manual%20configuration%2C%20and%20copy%20the%20relevant%20code.%3C%2FP%3E%0A%3CP%3ESome%20ADC%20training%20material%20is%20available%20on%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fpwmxy87654%2Fattachments%2Fpwmxy87654%2FS32K%2F46171%2F1%2FS32K3_RTD_Training_ADC_BCTU_TRGMUX.pdf%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Fpwmxy87654%2Fattachments%2Fpwmxy87654%2FS32K%2F46171%2F1%2FS32K3_RTD_Training_ADC_BCTU_TRGMUX.pdf%3C%2FA%3E%2C%20but%20good%20explanation%20of%20ADC%20usage%20with%20various%20triggering%20concepts%20is%20also%20given%20on%26nbsp%3B%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FRTD400-LLD-K344-ADC-SW-HW-trigger%2Fta-p%2F1966179%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FRTD400-LLD-K344-ADC-SW-HW-trigger%2Fta-p%2F1966179%3C%2FA%3E%3CBR%20%2F%3EAgain%20is%20is%20for%20S32K344%20but%20you%20can%20reuse%20principles%2Fconfigurations%20in%20your%20new%20created%20project%20for%20S32K311%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%3C%2FLINGO-BODY%3E