Skip to main content
Associate
March 11, 2024
Solved

ADC multichannel with DMA with more than 8 ADC channel

  • March 11, 2024
  • 1 reply
  • 2219 views

HI everybody,

i am using STM32G0B1 and in an older project i used successful ADC multichannel DMA 

conversion of 8 channel. I started a multichannel ADC conversion of 8 channel and a ADC callback

sets the finished bit and later on i read the result for 8 channel from DMA buffer and start a new 8-chan conversion again. It works well.


For a new project i want to keep this method for 10 channel but unfortunately i can only convert 8 channel

one after another, the Number Of Conversion in ADC Paramter Setting in MXCube is maximum 8,

Kai4_0-1710151106760.png

I guess, due to the ADC channel selection register, reserved only for max. 8 channel.


Now my question, how can i setup a DMA multichannel ADC conversion for 10 channel

without reprogramming Channel and Rank before each conversion ?

Possibly by an injected conversion of the 2 upper channel - if yes, pls with a hint for setting it right in CubeMX

and possible HAL code.

Thanks in advance,

Kai

This topic has been closed for replies.
Best answer by TDK

> Now my question, how can i setup a DMA multichannel ADC conversion for 10 channel without reprogramming Channel and Rank before each conversion ?

Set the sequencer to Not fully configurable. In that mode, all channels will be converted in order (forward) or in reverse order (backward) depending on how scan conversion mode is set.

TDK_0-1710163050682.png

 

1 reply

TDK
TDKBest answer
Super User
March 11, 2024

> Now my question, how can i setup a DMA multichannel ADC conversion for 10 channel without reprogramming Channel and Rank before each conversion ?

Set the sequencer to Not fully configurable. In that mode, all channels will be converted in order (forward) or in reverse order (backward) depending on how scan conversion mode is set.

TDK_0-1710163050682.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Kai4Author
Associate
March 13, 2024

Hi TDK,

thanks for your answer, it works.
I have chosen 10 channel with the above Sequencer setting 
and all 10 (marked) channel are measured one after another.

Kai4_0-1710344376417.png

That means the VBAT channel data will be stored in the dma array buffer with index 9.