2015-07-17 09:46 AM
I'm new to the STM32 and am trying to read three ADC channels on an F0 part. I've used the STM32CubeMX utility to configure my hardware and then have looked over some of the ADC examples in the STM32Cube_FW_F0_V1.2.0 package.
However, I've not seen a simple example that shows how to read three channels. I don't need fast access. I don't need DMA. I just need to read all three pins in a loop that's going to execute perhaps once every 100 milliseconds.Can someone help point me to some sample code?I tried using the ADC_DMA_Transfer example, but it seems that I only get one reading (not all three). I must be missing something simple.2015-07-17 10:33 AM
I don't need DMA.
The way the STM32 works, you kinda do. Can't help you with the HAL/Cube stuff.2015-07-17 12:26 PM
Thanks for the reply. Your code is using function calls I'm not familiar with. (eg: ADC_DMACmd()). The code generated by STM32CubeMX use functions in the form ''HAL_ADC_*''.
Which method is ''best''? And where can I find the routines that you used?I'm developing with the Keil uVision5, if that matters.2015-07-17 02:02 PM
I use the SPL (Standard Peripheral Library), a library ST has used in similar form for their ARM parts over the last decade or so.
http://www.st.com/web/en/catalog/tools/PF257884
Ignore all the distractions, there is a Red Download button way down at the bottom.