2023-09-15 04:10 AM
I am trying to use ADC in scan mode in discontinuous mode in stm32f446vet6. I have ranked my channels in the order I want them to be converted in the scan mode . During the initialization I have given the number of conversions as 4 since that is the number of channels I want to convert . I want to use the scan mode in polling method where in I am using the ADC_PollForConversion function to poll for the conversion and ADC_GetValue to get the value from DR but when I am doing this I am getting the same value repeated 4 times which is the ADC count for the 1st ranked channel
2023-09-15 06:19 AM
Use DMA to convert multiple channels at once. You can technically do this in polling mode, but the code needs to read the register before the next conversion comes in, which is not very practical.
Or convert a single channel and re-configure the ADC after every conversion for the next channel.