cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0: how can i setup 10 adc channels while there are just 8 number of conversions?

shishi
Associate II

Hello everybody,

i am using STM32G071RBTX and stm32cubide, using ADC1 for 10 analog pins and i nead to start conversions and read value of them one by one.

my problem is there are 10 analog pins which means 10 channels but i do not know how can i read them while there is just 8 number of conversions.

shishi_0-1688556355454.png

can anyone give me any clues?

7 REPLIES 7
AScha.3
Chief III

from rm :

AScha3_0-1688559953214.png

 

AScha3_1-1688560082176.png

 

so set > Sequencer -> not fully conf. ...

then can set all channels, not only up to 8 in sequence.

If you feel a post has answered your question, please click "Accept as Solution".
shishi
Associate II

if i change Sequencer then i would not have any more number o conversions to determine channels

shishi_0-1688560911018.png

 

 

raptorhal2
Lead

One method - in Cube MX configure the two pins to analog and regenerate the code for CubeIDE.

Second method - edit the ADC initialization code to 10 NumberOf Conversions, add the channel configuration code for the two channels, and increase the size of the conversion results buffer.

method one: i already configured for 10 analog pins.. i can not undrestand why should i configure it for 2 pins???

Second metod: it is not possible because the maximum amount of conversions is 8

For a second method example, review the HAL library Nucleo-G0B1RE example ADC_MultiChannelSingleConversion code. It is set up for three channels, but can be modified for 10 easily.

where can i find it? 

TDK
Guru

You can't sequence all 10 channels at once. You'll need to set it up to convert only 1 channel (CHSELRMOD=0) and change that channel after each conversion is complete.

If you feel a post has answered your question, please click "Accept as Solution".