Can I modify the ADC configuration in an ADC interrupt ?

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

Can I modify the ADC configuration in an ADC interrupt ?

跳至解决方案
933 次查看
Jerry_xie
Contributor II

Dear sir,

I am using the S32K116 sample and convert the 4 channel ADC0 by PDB back-to-back mode. From ADC0_CH3 to ADC0_CH6.

I want to use compare value function only in ADC0_CH4 & ADC0_CH5. 

Can I set the Compare Value function for ADC0_CH4 & ADC0_CH5 iADC interruptn an  before the ADC0_CH4 conversion and unset the compare Value function after the ADC0_CH5 conversion? 

( for example : set ADC0->CV[0] ,ADC0->CV[1], ADC_SC2_ACFE(x), ADC_SC2_ACFGT(x), ADC_SC2_ACREN(x) )     

 If not, could you give me some suggestions to realize this requirement?

Thanks & BRs,

XIECLOCKCLOCKADC_handleADC_handlePDB_initPDB_init

0 项奖励
回复
1 解答
908 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Jerry,

The CS2 register cannot be modified while there is a conversion in progress, the conversion would be aborted.

danielmartynek_0-1607612334384.png

So, it is not possible in the PDB back-to-back mode.
But you can use PDB with a separate delay for each channel instead of the back-to-back mode.
And change the CS2 register within a delay.

Best regards,
Daniel

在原帖中查看解决方案

1 回复
909 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Jerry,

The CS2 register cannot be modified while there is a conversion in progress, the conversion would be aborted.

danielmartynek_0-1607612334384.png

So, it is not possible in the PDB back-to-back mode.
But you can use PDB with a separate delay for each channel instead of the back-to-back mode.
And change the CS2 register within a delay.

Best regards,
Daniel