2024-08-23 05:01 AM
Hello,
I am using ADC1 channel 1, 3 and 5. All these three inputs are connected to different sensors and I want to create a driver to read those sensors. The problem is that I don't want to read all input channels at once, I want to be able to select which channel value to get. Also I want to use DMA and conversion complete interrupt. Is this possible? Which mode should I use to be able to tell ADC1 which channel value to convert? I am using HAL library. Right now I enabled scan mode, so after running HAL_ADC_Start_DMA() I get all sensors data.
2024-08-23 06:16 AM
Hello,
Right now I enabled scan mode, so after running HAL_ADC_Start_DMA() I get all sensors data.
Why Scan mode is not suitable for you? As you can read all the channels but at final you use the value you need.
2024-08-23 06:20 AM
You can convert a single channel at a time. After conversion, stop the ADC and reconfigure it to convert the next channel. You will need to reconfigure it on every conversion.
Seems easier to convert all channels at the same time. What's the drawback there?