conflits when using several ADC components with KL25Z

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

conflits when using several ADC components with KL25Z

Jump to solution
605 Views
ise1
Contributor III

Hello everybody ! :smileywink:
I have some trouble with using several analog sensor. In fact I need for my project to get values from 4 analog sensor each 100 ms.
I know that the KL25Z board has only one ADC but I'm sure that the ADC can be shared to different analog component.
Here is what I've done: I've declared two ADC component at PTC2 and PTB3 pins. I've selected the "shared" option but I get the error message "The shared mode is not supported on this version of module". What can I do to share the ADC to each analog component ? and why the shared mode is not supported here ?
When the sharing option is unselected, I get the error message "error in the inherited component" because ADC_LDD is already used by the other ADC component.
I hope you will be able to help me.
Thank you in advance :smileywink:

0 Kudos
1 Solution
444 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Sebastien,

You needn't two ADC_LDD component in your project to measure two channels. Use one instance of ADC_LDD in your application and add one channel into the ADC_LDD component (so you have two channels in the ADC_LDD component that can be measured), see the following screenshot:

ADC Channels usage.png

You can also enable static sample groups, define one sample group for each channel and use methods SelectSampleGroup and StartSingleMeasurement for measuring these channels (software triggering). Or you can use (hardware) triggers, see the Trigger group in the Compnent Inspector.

For details see the help of the ADC_LDD component. There is also an example of typical usage.

Best Regards,

Marek Neuzil

View solution in original post

0 Kudos
2 Replies
445 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Sebastien,

You needn't two ADC_LDD component in your project to measure two channels. Use one instance of ADC_LDD in your application and add one channel into the ADC_LDD component (so you have two channels in the ADC_LDD component that can be measured), see the following screenshot:

ADC Channels usage.png

You can also enable static sample groups, define one sample group for each channel and use methods SelectSampleGroup and StartSingleMeasurement for measuring these channels (software triggering). Or you can use (hardware) triggers, see the Trigger group in the Compnent Inspector.

For details see the help of the ADC_LDD component. There is also an example of typical usage.

Best Regards,

Marek Neuzil

0 Kudos
444 Views
ise1
Contributor III

Thanks Marek, this works fine :smileywink:

0 Kudos