STM32 and ADC (BluePill)

Submitted by tjm on Sun, 07/21/2019 - 22:03

Hi.  Can't find a proper place for this so you folks will need to suffer through this, please.  I just went through the article here for stm32 and ADC usage and I'm thinking I need some more info that probably falls somewhere between the Arduino IDE and the STMcubeIDE operation and associated coding differences.   

The goal is for 4 or more ADC pressure sensor inputs, but just 4 for now.  It's not clear to me whether the Arduino code sets the ADC in single conversion mode that is read once each time the data is requested from analogRead() from a pin, OR, is the ADC set in continuous conversion mode so that the  new data is actually there when the analogRead() function is used repeatedly.  So, for my own understanding, if I have a loop that reads 4 pins with analogRead() and the ADC is set in single conversion mode will the analogRead() request initiate another conversion or will the same date be read at the pin.  Or, would it be required to set the ADC in continuous conversion mode so that updated data will be available for the analogRead() at any time.  I guess I can just try this but coding-wise I'm not there yet since I've only been playing with the stm32 for about a week or so.

Thanks for any info,


Should have been "same DATA be read at the pin" .

No editing function.

  Joined July 21, 2019      2
Sunday at 09:21 PM