Hi together
In a project I use a S32K148.
There I want to use the ADC0 to measure different signals.
For this i configured the different channels:
Now I have the problem, that only the first channel is working.
I initialized the the converter like this:
To start a conversion and wait until conversion is done I use the following functions (example from adConv0_ChnConfig1):
If I debug the application, it seems that the conversion is not getting started, because within ADC_DRV_WaitConvDone() the active flag is checked.
When the conversion is not started, I think the flag will be not active. In this case the ADC_DRV_WaitConvDone() will return and there is no result.
If I use ADC_DRV_GetConvCompleteFlag() instead of ADC_DRV_WaitConvDone() , the programm blocks at this line. In my opinion this means also that the conversion is not started.
What could be wrong with that? Channel 0 (ADC_INPUTCHAN_EXT4) is working, the others don't work.
Thanky for your help
Regards
Mario
Hi,
in Software trigger mode just channel 0 can be used to start a conversion. Writes to other channels do not initiate a new conversions.
BR, Petr
Hi Petr
Thanky for the information.
Is there a other similar way to initiate a conversion on the other channels?
I use the adc component from Processor Expert
It seems weird to me, if there is a possibility to setup different channel configurations but only one channel can be used then.
Best regards
Mario
Hi,
channel configuration defines which external channel will be measured and if interrupt is generated upon conversion. In SW trigger mode just a channel 0 initiate a conversion and so channel 0 must be used but you can select desired channel configuration within driver function.
If you want to convert more channels, e.g. in a chain, then HW trigger mode can be selected and PDB module can be used to trigger more channels to be converted, either at a specific time or in so called back-to-back mode.
You can refer to below example for PDB usage for multiple channel conversion
https://community.nxp.com/docs/DOC-343295
BR, Petr
Hi Petr
I want to convert more multiple channels, but not at the same time. I want to have a function where I can start a conversion of a single channel (whenever it is needed to be converted) during the programm sequence.
But if you say that is not possible, I will have a look at your example.
But I found now a solution for me:
I used the adc_pal component of processor expert.
There I set u the different signals each in a seperate group.
Now I can start each single group conversion independent from each other.
Regards Mario