ADC SW Triggering not working

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ADC SW Triggering not working

1,629 次查看
EE_CW
Contributor III

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:

pastedImage_1.png

Now I have the problem, that only the first channel is working.

I initialized the the converter like this:

pastedImage_2.png

To start a conversion and wait until conversion is done I use the following functions (example from adConv0_ChnConfig1):

pastedImage_3.png

If I debug the application, it seems that the conversion is not getting started, because within ADC_DRV_WaitConvDone() the active flag is checked.

pastedImage_1.png

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

0 项奖励
回复
4 回复数

1,472 次查看
PetrS
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复

1,472 次查看
EE_CW
Contributor III

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

pastedImage_1.png

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

0 项奖励
回复

1,472 次查看
PetrS
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复

1,472 次查看
EE_CW
Contributor III

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

0 项奖励
回复