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.
Solved! Go to Solution.
Hi @vasanth-sr
To use Adc read without interrupt, you need to enable this feature in Group configurations array container
Then disable Interrupt EOC in AdcInterrupt container:
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
Let's follow this to enable Adc without interrupt:
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
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
Hi @vasanth-sr
To use Adc read without interrupt, you need to enable this feature in Group configurations array container
Then disable Interrupt EOC in AdcInterrupt container:
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
@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) */