2023-07-05 05:01 AM
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.
can anyone give me any clues?
2023-07-05 05:27 AM - edited 2023-07-05 05:28 AM
from rm :
so set > Sequencer -> not fully conf. ...
then can set all channels, not only up to 8 in sequence.
2023-07-05 05:33 AM - edited 2023-07-05 05:42 AM
if i change Sequencer then i would not have any more number o conversions to determine channels
2023-07-05 06:04 AM
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.
2023-07-05 06:08 AM
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
2023-07-05 09:29 AM
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.
2023-07-06 12:14 AM
where can i find it?
2023-07-06 07:06 AM
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.