read adc without interrupt in s32k312,

cancel
Showing results for 
Search instead for 
Did you mean: 

read adc without interrupt in s32k312,

369 Views
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 Kudos
4 Replies

332 Views
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 Kudos

321 Views
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 Kudos

326 Views
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 Kudos

337 Views
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 Kudos