Showing results for 
Search instead for 
Did you mean: 

stm32l072 adc multi channel reading problem

Associate II

I am trying to read multiple ADC channels using the Stm32l072 microcontroller, but in CubeMX, the options for rank assignments, which I normally use to read the channels, are not available. After manually adding these rank assignments to the init functions, I noticed that when I try to read multiple channels in normal mode, both channels show the same values, indicating that I am unable to perform multi-channel reading.

I then attempted to perform this ADC reading using DMA, but observed that my reference voltage, which should be around 4095, was divided by the number of channels I was reading. For example:

  • Number of channels to read: 4 -> VREF ADC value: 1.023
  • Number of channels to read: 3 -> VREF ADC value: 1.365

Normally, my VREF should be 3.29V, which is very close to 4090. This observation led me to realize that I am unable to read even a single channel correctly. How can I perform multiple ADC readings with this microcontroller?



Associate III



Have configured the DMA correctly?

Please refer the below images for DMA and ADC configurations.



Yes, I have the correct settings for dma, but configurations such as rank assignment that appear in your 2nd image do not appear on my cubemx. This is exactly my problem.




Read this once.



I think you have to configure this scan register and it will convert sequentially one by one.