Can I modify the ADC configuration in an ADC interrupt ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can I modify the ADC configuration in an ADC interrupt ?

ソリューションへジャンプ
899件の閲覧回数
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 解決策
874件の閲覧回数
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 返信
875件の閲覧回数
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