cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 Disvovery Cube ADC general questions

maxpohl88
Associate
Posted on June 17, 2015 at 16:58

Hi guys,

i just switched from 16bit Microchip to STM32F0.

I use Cube and HAL Library.

Simply want to convert three ADC Channels (ADC1, Temperature Sensor, Vrefint).

I use the following code to convert ADC1:

    HAL_ADC_Start(&hadc);        

    HAL_ADC_PollForConversion(&hadc, 100);

    adc_result = HAL_ADC_GetValue(&hadc);

How can i change the channel to access the result of the other ADC channels.

The available documentation is very bad .

regards

Max
1 REPLY 1
Posted on June 17, 2015 at 17:39

I use Cube and HAL Library... The available documentation is very bad .

I'd be questioning your choices too. I didn't spend a lot of time on the documentation, but did find the implementation to be cumbersome.

Multiple channels are usually done with DMA on STM32 parts, you can keep reconfiguring the ADC, but that's a bit of a circus.

Here's some Standard Peripheral Library example code

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F0%20ADC-DMA%20touble&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=1396

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..