cancel
Showing results for 
Search instead for 
Did you mean: 

using ADC to convert two channels

ayaka
Associate II
Posted on July 09, 2010 at 01:47

using ADC to convert two channels

3 REPLIES 3
swhite2
Associate III
Posted on May 17, 2011 at 13:58

I guess I don't understand your reluctance to use DMA. It is very easy to configure and you can still use interrupts so you know when the results are updated.

There is only one ADC  conversion result register so unless you're careful the last value can be easily overwritten.

picguy2
Associate II
Posted on May 17, 2011 at 13:58

You can use injected channel for up to 4 ADC conversions without DMA.  Look at ST’s  injected channel code.  The first channel converted result ends up in ADC_JDR4, the second in ADC_JDR3.

With DMA you can start a continuous conversion with ADC values going to  RAM.  No interrupts required.  Simply grab the latest value from RAM.  I have used this with one DMA channel.  I think it might work with two or more.
t1
Associate II
Posted on May 17, 2011 at 13:58

If the issue is that there is insufficent time to read the ADC data register before it is overwritten by the next conversion, then I would have thought that you could increase the sampling times for the two channels to give you a longer time to grab the data.