cancel
Showing results for 
Search instead for 
Did you mean: 

i would like to know, how to use ADC1 in stm32f103c8t6 - blue pill - in scan multichannel continous mode conversion mode without interrupt..

Iwael.1
Associate

 that's it.. say i have 4 channels (PA0 , pA1 , PA2 , pA3)..what i need is : in the while(1) loop i put 4 variables, and keep reading the data registers , and because it's in continous mode, so the 4 variables keep updating in the backgroud, how can i do that ?! i already done the driver and tested it with one channel and it worked great. but in case of 4 channels , the readings are the same while the supposed not..the problem i think is that data overrun occur to data register so i keep reading the value of one channel only and put it in the 4 variabnles..

so the question is.. how can i stop the adc after each conversion till i read the data register then continue with the second channel , third , forth .. then repeat in order. is that possible ? thanks.

2 REPLIES 2
Houssem CHAABANI
Senior II

Hi @Iwael.1​ ,

You can use STM32CubeMX to configure the ADC:

Navigate to Analog then choose your ADC then in the ADC_Settings you can enable continuous Conversion Mode.

You need also to choose your channels.

After that you can generate you code.

Hope that this helps you.

Houssem

Ozone
Lead II

The "old" SPL examples for the F103 ADC used this method, albeit with DMA.

Configure the ADC for your number of channels, and DMA for the required number of transfers, and you are fine.

I hope you realize it is very hard to achieve synchronized ("equidistant") values for your channels.

Perhaps that does not matter for your application.

Last time I checked, the SPL was still available for download on ST's website.