cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple ADC's on STM32F0

shrum
Associate
Posted on March 30, 2014 at 19:25

Hello, 

I have been having some trouble initializing multiple ADC on my STM32F0 discovery board. I need to sample 4 ADC at a time (or at least one after the other). Does anyone have some example code for initializing 4 ADC and activating the DMA properly to do this?

Thank you!

#lmgtfy
3 REPLIES 3
Posted on March 30, 2014 at 20:05

Google could be you friend...If you let it.

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F0%20ADC-DMA%20touble&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=35]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FSTM32F0%20ADC-DMA%20touble&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=35
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
alex239955
Associate
Posted on November 25, 2014 at 00:41

Hello,

I get the Discovery kit firmware  ''STSW-STM32049'' from ST web below:

http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF257885

We used example ''ADC_LowPower'' with one ADC channel. It is working well.

When I added one more channel (two channels) total in the example. it didn't work. Is it possible to reading multi ADC channels without using DMA? How can I select (MUX) channel for reading its vale from decicate channel?

Thanks!

Posted on November 25, 2014 at 01:53

I'm not using the F0, but as I understand it the device has a singular ADC. The model used by ST for multiple channels is to DMA the values into an array, as the values are coming quickly, with well define periodicity and the IRQ loading would be ridiculous to do otherwise. It scans sequential through a list, this can be triggered, or looped continuously.

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