cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 simultaneous ADC1 and ADC3

quackster
Associate
Posted on April 03, 2012 at 06:52

I have a project involving STM32F103RE.

A timer channel TIM2_CH2 triggers a continuous read on ADC1, which uses DMA1 into a buffer.

What I want to do is set up ADC3 to read a different channel in a similar fashion using DMA2.

* How can I make sure ADC1 and ADC3 are in sync? ADC3 has a different list of trigger options - is there a way I can start the continuous conversion off the same trigger?

* If TIM5 has the same setup as TIM2, and both timers are started simultaneously (or right after another) can I use TIM5_CH1 to trigger ADC3 at the same time as ADC1 is triggered by TIM2_CH2?

Note that I have already considered using ADC1/ADC2 in dual simultaneous mode, but the resulting data would then need to be post-processed because of how the DMA works.
1 REPLY 1
quackster
Associate
Posted on April 12, 2012 at 01:54

So, it can be done, and here's how:

Let's say you want to use ADC1 and ADC3 simultaneously, using DMA to push the results into 2 separate buffers.

You can use a timer channel for each ADC to trigger the start of the continuous read.

Then to get the ADCs in sync, you need to set the timers you've chosen in master/slave mode, such that one timer is gated by the enable of the other.