cancel
Showing results for 
Search instead for 
Did you mean: 

Relaunch the ADC and DMA on STM32F2

gilles2399
Associate II
Posted on April 17, 2012 at 15:34

Relaunch the ADC and DMA on STM32F2

3 REPLIES 3
gilles2399
Associate II
Posted on April 18, 2012 at 15:31

If my question isn't very clear,  please tell it to me.

 

raptorhal2
Lead
Posted on April 18, 2012 at 18:09

Your question is clear.

I don't see any ADC_DMACmd(ADC1, ENABLE);

Cheers, Hal

raptorhal2
Lead
Posted on April 19, 2012 at 14:59

Can you explain How this command works ? I understood that it enable the transfer between the DMA and the ADC.

It enables the DMA to read the ADC conversion register upon each conversion completion, and transfer that value to the next buffer memory location.

I also tried to put in my code only  : ADC_DMACmd(ADC1, ENABLE), in this case I have no duplicated points but always the Peak on the 3 first samples.

This is the correct code. ADC1 is the master control, enabling ADC2 and ADC 3 DMA is not required.

Can you give me piece of advice on where to put this command in my code?

You need it at least before the first launch. Try also disabling and reenabling it for each launch.

I am not sure this will solve the problem. Perhaps it is a timing problem. What is the signal frequency, trigger frequency and relaunch frequency? Or perhaps it is a problem in extracting the data from the buffer. If you can't find the problem, post the related timer and buffer code.

Cheers, Hal