Skip to main content
Associate
July 5, 2023
Question

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

  • July 5, 2023
  • 4 replies
  • 2990 views

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?

    This topic has been closed for replies.

    4 replies

    AScha.3
    Super User
    July 5, 2023

    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""."
    shishiAuthor
    Associate
    July 5, 2023

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

    shishi_0-1688560911018.png

     

     

    raptorhal2
    Lead
    July 5, 2023

    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.

    shishiAuthor
    Associate
    July 5, 2023

    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

    raptorhal2
    Lead
    July 5, 2023

    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.

    TDK
    Super User
    July 6, 2023

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