STM32F051 adc interrupt problem. Multiple channels.
STM32F051 ADC sample 5 channels with interrupt.
I'm trying to sample 5 channels using an interrupt. (I'll get to DMA later:0))
If I set the sample time to ('ADC_SAMPLETIME_41CYCLES_5') or longer then the code works as expected.
Every interrupt I check the ('ADC_FLAG_EOC') flag , if set , store the adc result in an array and increment the array index. After 5 conversions the ('ADC_FLAG_EOS') flag is also set. Then reset the array index and process the data in the array.
If I set the sample time to less than the above , the ('ADC_FLAG_EOS') flag is set after only 3 conversions!!
If I set the sample time to ('ADC_SAMPLETIME_7CYCLES_5') , the ADC interrupt never fires.
What could be going on here. I understand that having a small sample time could affect the accuracy of the result , but why is it changing the behavior of the system?
I can post the code if required , but maybe someone has a quick answer
:)
Cheers
Rob
