read adc without interrupt in s32k312,

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

read adc without interrupt in s32k312,

ソリューションへジャンプ
1,436件の閲覧回数
vasanth-sr
Contributor II

Hi 

i am using the s32k312 ev board. In that adc read example code was interrupt based code.

how to read the ADC value without interrupt?

how to enable AdcWithoutInterrupts flag in s32k312 .

please share the steps and examples.

 

Regards,

vasanth sr.

0 件の賞賛
1 解決策
1,404件の閲覧回数
cuongnguyenphu
NXP Employee
NXP Employee

Hi @vasanth-sr 
To use Adc read without interrupt, you need to enable this feature in Group configurations array container

cuongnguyenphu_0-1673341950417.png

Then disable Interrupt EOC in AdcInterrupt container:

cuongnguyenphu_1-1673341988069.png


When using this feature, you don't need to config interrupt after conversions, instead, only Adc_ReadGroup() can be used to get conversion results. 
So the sequence in implementation should be:
Adc_SetupResultBuffer();
Adc_StartGroupConversion();
Adc_ReadGroup();

Please see my example in attachment, it's modified from S32K344 ADC example, but you can use the same sequence for S32K312

元の投稿で解決策を見る

0 件の賞賛
5 返答(返信)
1,399件の閲覧回数
vasanth-sr
Contributor II

Hi,

I m using S32design studio 3.5.

I don't have this enable option.

I attached the screen short , please find the attachment.

 

Regards,

vasanth

0 件の賞賛
1,388件の閲覧回数
cuongnguyenphu
NXP Employee
NXP Employee

Let's follow this to enable Adc without interrupt:

cuongnguyenphu_0-1673408057843.pngcuongnguyenphu_1-1673408076919.pngcuongnguyenphu_2-1673408086674.png


Because we cannot check Interrupt notification to notify the conversion finished, then we need to use timer and polling function ReadGroup() to get Adc results

0 件の賞賛
1,393件の閲覧回数
Nanettebreaux
Contributor I

According to the approach in your codes, inside the while (1) loop, you are just polling the timer overflow interrupt flag and simply get the ADC result after timer, so timer and ADC interrupts are not required to enable and hence global interrupt is not required to enable.   MyGeorgiaSouthern

0 件の賞賛
1,405件の閲覧回数
cuongnguyenphu
NXP Employee
NXP Employee

Hi @vasanth-sr 
To use Adc read without interrupt, you need to enable this feature in Group configurations array container

cuongnguyenphu_0-1673341950417.png

Then disable Interrupt EOC in AdcInterrupt container:

cuongnguyenphu_1-1673341988069.png


When using this feature, you don't need to config interrupt after conversions, instead, only Adc_ReadGroup() can be used to get conversion results. 
So the sequence in implementation should be:
Adc_SetupResultBuffer();
Adc_StartGroupConversion();
Adc_ReadGroup();

Please see my example in attachment, it's modified from S32K344 ADC example, but you can use the same sequence for S32K312

0 件の賞賛
699件の閲覧回数
shunyizhang
Contributor III

@cuongnguyenphu Hi,

Why is the ADC initialization interface in this example "NULL_PTR" so that the ADC can be used normally after initialization?

 

#define ADC_PRECOMPILE_SUPPORT (STD_ON)

#if (ADC_PRECOMPILE_SUPPORT == STD_ON)
Adc_Init(NULL_PTR);
#else
Adc_Init(&Adc_Config_VS_0);
#endif /* (ADC_PRECOMPILE_SUPPORT == STD_ON) */

0 件の賞賛