cancel
Showing results for 
Search instead for 
Did you mean: 

ADC multichannel with DMA with more than 8 ADC channel

Kai4
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

> 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".

View solution in original post

3 REPLIES 3
TDK
Guru

> 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".
Kai4
Associate II

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.

MKanc.1
Associate III

I was looking to understand ADC behavior and found your answer. Is there any resource link explaining ADC settings in CubeIDE?