ADC MCXA153 sampling

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

ADC MCXA153 sampling

836 Views
Transidico
Contributor III

Good morning,

I have the following problem: I am using 6 ADC channels to sample currents at high speed. I have created a chain of commands from 1 to 6, where the first command is triggered by trigger 0.

I need to read two voltages using two additional channels (the input VCC and the value of a PT100).

I was wondering if it’s possible to sample the channels differently, with the 1–6 chain at high speed and the 7–8 chain at a slower rate. Or do I have to use a single chain where I sample all the channels and process them only when necessary? The second option would force me to sample the currents more slowly, as I’m always sampling all the channels in sequence.

Thanks for your advice.

Best regards

 

 

0 Kudos
Reply
4 Replies

775 Views
luis_maravilla
NXP Employee
NXP Employee

Hello,

Could you help us confirm if you set the configuration for the ADC via MCUXpresso Config Tools>Peripherals?

If not, we recommend using the Config tool inside MCUXpresso IDE to set this up, by doing modifications on the ADC0 configuration tab, It can generate the code automatically and you can see the changes applied in peripherals.c

I generate a configuration for ADC using an SDK example for setup based on your description and it compile without errors; you could apply the modifications for your application and let me know if it's possible.

In the following photo I created a chain of commands from 1-6 [Green squares] where the first command is triggered by trigger 0 [Blue squares] and select a x sample time mode [yellow square].

Then in another chain of commands from 7-8 used a different sample time mode, to sample the channels differently, and create a different Trigger [TRIGGER 1] for this chain.

luis_maravilla_0-1776295440244.png

Additionally, I would recommend checking on the MCX A153 Reference Manual Chapter 40 for all the information regarding the ADC configuration;

And AN14390: MCXA14x/15x ADC Usage and Calculator Tool | NXP Semiconductors could help you in the trigger and CMD information, the application note provides detail explanation of the ADC usage in MCXA15x.

Best Regards, Luis

0 Kudos
Reply

766 Views
Transidico
Contributor III

Good morning.

Yes, I used the peripherals tool to generate the code.

As you can see, I have the sequence 1-2-3-4-5-6, which starts with trigger 0:

Transidico_1-1776322144672.png

The command ends with no subsequent command.

I have linked trigger 1 to the 7-8 chain:

Transidico_2-1776322401602.png

If I run the software with these settings, I get the following error:

Transidico_0-1776322043754.png

Could you tell me if I’m making any configuration errors that I haven’t realised?

Thank you very much.
Have a good day.

0 Kudos
Reply

689 Views
luis_maravilla
NXP Employee
NXP Employee

Could you help us confirm if you are using the MCXA153 in FRDM-MCXA153 or the individual chip in a custom board? If it’s the individual chip could you help us sharing the complete name of the device?

I see in your photos that when selecting "Channel Number" your ADC says "A, 0 » [14] ADC_I3_600"

When I do the configuration on my side the ADC shows [A, 0 » [14] P2_0/WUU0_IN18/TRIG_IN6/LPUART0_RXD/CT_INP16/CT2_MAT0/ADC0_A0]

And from the MCXA153 Reference Manual Chapter 40.1.2 ADC Connections table, I don’t recognize ADC_I3_600, Could you help us bring details on how you setup the channel?

Can you select any ADC0_Ax option?

luis_maravilla_1-1776710945200.png

Are you using an SDK example as a base or it is a new project?

Is there additional information about your setup that you can share with us?

0 Kudos
Reply

532 Views
Transidico
Contributor III

Good morning,

I apologise for the delay in my reply.

I am using the FRDM-MCXA153 board.
I need the term ‘ADC_I3_600’ to give the channel an identifying name, a label.

I am not using the SDK examples, as I have not found them useful for the configuration I have in mind with a dual conversion chain. What does the error shown above mean?
Thank you for your reply

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2350186%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EADC%20MCXA153%20sampling%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2350186%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EGood%20morning%2C%3C%2FP%3E%3CP%3EI%20have%20the%20following%20problem%3A%20I%20am%20using%206%20ADC%20channels%20to%20sample%20currents%20at%20high%20speed.%20I%20have%20created%20a%20chain%20of%20commands%20from%201%20to%206%2C%20where%20the%20first%20command%20is%20triggered%20by%20trigger%200.%3C%2FP%3E%3CP%3EI%20need%20to%20read%20two%20voltages%20using%20two%20additional%20channels%20(the%20input%20VCC%20and%20the%20value%20of%20a%20PT100).%3C%2FP%3E%3CP%3EI%20was%20wondering%20if%20it%E2%80%99s%20possible%20to%20sample%20the%20channels%20differently%2C%20with%20the%201%E2%80%936%20chain%20at%20high%20speed%20and%20the%207%E2%80%938%20chain%20at%20a%20slower%20rate.%20Or%20do%20I%20have%20to%20use%20a%20single%20chain%20where%20I%20sample%20all%20the%20channels%20and%20process%20them%20only%20when%20necessary%3F%20The%20second%20option%20would%20force%20me%20to%20sample%20the%20currents%20more%20slowly%2C%20as%20I%E2%80%99m%20always%20sampling%20all%20the%20channels%20in%20sequence.%3C%2FP%3E%3CP%3EThanks%20for%20your%20advice.%3C%2FP%3E%3CP%3EBest%20regards%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2351804%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20ADC%20MCXA153%20sampling%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2351804%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3ECould%20you%20help%20us%20confirm%20if%20you%20set%20the%20configuration%20for%20the%20ADC%20via%20MCUXpresso%20Config%20Tools%26gt%3BPeripherals%3F%3C%2FP%3E%0A%3CP%3EIf%20not%2C%20we%20recommend%20using%20the%20Config%20tool%20inside%20MCUXpresso%20IDE%20to%20set%20this%20up%2C%20by%20doing%20modifications%20on%20the%20ADC0%20configuration%20tab%2C%20It%20can%20generate%20the%20code%20automatically%20and%20you%20can%20see%20the%20changes%20applied%20in%20peripherals.c%3C%2FP%3E%0A%3CP%3EI%20generate%20a%20configuration%20for%20ADC%20using%20an%20SDK%20example%20for%20setup%20based%20on%20your%20description%20and%20it%20compile%20without%20errors%3B%20you%20could%20apply%20the%20modifications%20for%20your%20application%20and%20let%20me%20know%20if%20it's%20possible.%3C%2FP%3E%0A%3CP%3EIn%20the%20following%20photo%20I%20created%20a%20chain%20of%20commands%20from%201-6%20%5BGreen%20squares%5D%20where%20the%20first%20command%20is%20triggered%20by%20trigger%200%20%5BBlue%20squares%5D%20and%20select%20a%20x%20sample%20time%20mode%20%5Byellow%20square%5D.%3C%2FP%3E%0A%3CP%3EThen%20in%20another%20chain%20of%20commands%20from%207-8%20used%20a%20different%20sample%20time%20mode%2C%20to%20sample%20the%20channels%20differently%2C%20and%20create%20a%20different%20Trigger%20%5BTRIGGER%201%5D%20for%20this%20chain.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22luis_maravilla_0-1776295440244.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22luis_maravilla_0-1776295440244.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22luis_maravilla_0-1776295440244.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22luis_maravilla_0-1776295440244.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22luis_maravilla_0-1776295440244.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F382500i81F6A0E85AADADC5%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22luis_maravilla_0-1776295440244.png%22%20alt%3D%22luis_maravilla_0-1776295440244.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAdditionally%2C%20I%20would%20recommend%20checking%20on%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fwebapp%2FDownload%3FcolCode%3DMCXAP64M96FS3RM%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EMCX%20A153%20Reference%20Manual%3C%2FA%3E%20Chapter%2040%20for%20all%20the%20information%20regarding%20the%20ADC%20configuration%3B%3C%2FP%3E%0A%3CP%3EAnd%20%3CA%20href%3D%22https%3A%2F%2Fdocs.nxp.com%2Fbundle%2FAN14390%2Fpage%2Ftopics%2Fintroduction.html%3F_gl%3D1*1ynhlfj*_ga*MTE4OTQwMTA4OS4xNzM0NzE4NDY0*_ga_WM5LE0KMSH*czE3NzYyODM4NTEkbzIxMiRnMSR0MTc3NjI4ODY2MiRqNjAkbDAkaDEyNTcyMDUxMzc.%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EAN14390%3A%20MCXA14x%2F15x%20ADC%20Usage%20and%20Calculator%20Tool%20%7C%20NXP%20Semiconductors%3C%2FA%3E%20could%20help%20you%20in%20the%20trigger%20and%20CMD%20information%2C%20the%20application%20note%20provides%20detail%20explanation%20of%20the%20ADC%20usage%20in%20MCXA15x.%3C%2FP%3E%0A%3CP%3EBest%20Regards%2C%20Luis%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2352014%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20ADC%20MCXA153%20sampling%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2352014%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EGood%20morning.%3C%2FP%3E%3CP%3EYes%2C%20I%20used%20the%20peripherals%20tool%20to%20generate%20the%20code.%3C%2FP%3E%3CP%3EAs%20you%20can%20see%2C%20I%20have%20the%20sequence%201-2-3-4-5-6%2C%20which%20starts%20with%20trigger%200%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Transidico_1-1776322144672.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Transidico_1-1776322144672.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Transidico_1-1776322144672.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Transidico_1-1776322144672.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F382564iC2B5F29E1E66247A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Transidico_1-1776322144672.png%22%20alt%3D%22Transidico_1-1776322144672.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20command%20ends%20with%20no%20subsequent%20command.%3C%2FP%3E%3CP%3EI%20have%20linked%20trigger%201%20to%20the%207-8%20chain%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Transidico_2-1776322401602.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Transidico_2-1776322401602.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Transidico_2-1776322401602.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Transidico_2-1776322401602.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F382565i50F67E38339ECF3B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Transidico_2-1776322401602.png%22%20alt%3D%22Transidico_2-1776322401602.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIf%20I%20run%20the%20software%20with%20these%20settings%2C%20I%20get%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Transidico_0-1776322043754.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Transidico_0-1776322043754.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Transidico_0-1776322043754.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Transidico_0-1776322043754.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F382561iB03D424BD3D15AEB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Transidico_0-1776322043754.png%22%20alt%3D%22Transidico_0-1776322043754.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ECould%20you%20tell%20me%20if%20I%E2%80%99m%20making%20any%20configuration%20errors%20that%20I%20haven%E2%80%99t%20realised%3F%3C%2FP%3E%3CP%3EThank%20you%20very%20much.%3CBR%20%2F%3EHave%20a%20good%20day.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2353840%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20ADC%20MCXA153%20sampling%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2353840%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECould%20you%20help%20us%20confirm%20if%20you%20are%20using%20the%20MCXA153%20in%20FRDM-MCXA153%20or%20the%20individual%20chip%20in%20a%20custom%20board%3F%20If%20it%E2%80%99s%20the%20individual%20chip%20could%20you%20help%20us%20sharing%20the%20complete%20name%20of%20the%20device%3F%3C%2FP%3E%0A%3CP%3EI%20see%20in%20your%20photos%20that%20when%20selecting%20%22Channel%20Number%22%20your%20ADC%20says%20%22A%2C%200%20%C2%BB%20%5B14%5D%20%3CSTRONG%3EADC_I3_600%3C%2FSTRONG%3E%22%3C%2FP%3E%0A%3CP%3EWhen%20I%20do%20the%20configuration%20on%20my%20side%20the%20ADC%20shows%20%5BA%2C%200%20%C2%BB%20%5B14%5D%20P2_0%2FWUU0_IN18%2FTRIG_IN6%2FLPUART0_RXD%2FCT_INP16%2FCT2_MAT0%2F%3CSTRONG%3EADC0_A0%3C%2FSTRONG%3E%5D%3C%2FP%3E%0A%3CP%3EAnd%20from%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fwebapp%2FDownload%3FcolCode%3DMCXAP64M96FS3RM%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EMCXA153%20Reference%20Manual%3C%2FA%3E%20Chapter%2040.1.2%20ADC%20Connections%20table%2C%20I%20don%E2%80%99t%20recognize%20ADC_I3_600%2C%20Could%20you%20help%20us%20bring%20details%20on%20how%20you%20setup%20the%20channel%3F%3C%2FP%3E%0A%3CP%3ECan%20you%20select%20any%20ADC0_Ax%20option%3F%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22luis_maravilla_1-1776710945200.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22luis_maravilla_1-1776710945200.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22luis_maravilla_1-1776710945200.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F382994i39C8D242C8089E3B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22luis_maravilla_1-1776710945200.png%22%20alt%3D%22luis_maravilla_1-1776710945200.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAre%20you%20using%20an%20SDK%20example%20as%20a%20base%20or%20it%20is%20a%20new%20project%3F%3C%2FP%3E%0A%3CP%3EIs%20there%20additional%20information%20about%20your%20setup%20that%20you%20can%20share%20with%20us%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2356342%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20ADC%20MCXA153%20sampling%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2356342%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EGood%20morning%2C%3C%2FP%3E%3CP%3EI%20apologise%20for%20the%20delay%20in%20my%20reply.%3C%2FP%3E%3CP%3EI%20am%20using%20the%20FRDM-MCXA153%20board.%3CBR%20%2F%3EI%20need%20the%20term%20%E2%80%98ADC_I3_600%E2%80%99%20to%20give%20the%20channel%20an%20identifying%20name%2C%20a%20label.%3C%2FP%3E%3CP%3EI%20am%20not%20using%20the%20SDK%20examples%2C%20as%20I%20have%20not%20found%20them%20useful%20for%20the%20configuration%20I%20have%20in%20mind%20with%20a%20dual%20conversion%20chain.%20What%20does%20the%20error%20shown%20above%20mean%3F%3CBR%20%2F%3EThank%20you%20for%20your%20reply%3C%2FP%3E%3C%2FLINGO-BODY%3E