2024-11-23 03:47 AM
I am trying to read multiple channels of ADC (like Temperature sensor channel, Vbat channel, Vrefint ...) using the interrupt method, but I am not able to read all the Channel readings , only the readings of first channel is being reflected for all the channels. I have configured the ranks for each channel and the end of conversion is set to End of Sequence Conversion. If anyone has any Idea on how to read multiple channels of ADC using interrupt, do answer and help.
2024-11-23 07:04 AM
Because it doesn't work that way.
All channels of one ADC have one common result register, which reflects the result of the last conversion.
If you have a sequence of several channels, you need either to keep track of the channels and gather the results by individual EOC interrupts before the next conversion finishes, or use DMA with a matching configuration and configure a DMA TC (transmission complete) interrupt to pick up all results at once.
I'm not a HAL/Cube user, I don't know how it is done there.
But I recommend to consult the reference manual (ADC interrupts section) to get a better understanding.
2024-11-25 07:45 AM
Hello @Sumukha
Please, refer to the LL example Projects/STM32F411RE-Nucleo/Examples_LL/ADC/ADC_MultiChannelSingleConversion as starting point for your application. The covertion is handled by the DMA and the IT.