cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with ADC using DMA and timer

muntu_the_killer
Associate II
Posted on October 15, 2013 at 12:31

The original post was too long to process during our migration. Please click on the attachment to read the original post.
7 REPLIES 7
muntu_the_killer
Associate II
Posted on October 15, 2013 at 14:02

Hi again Clive!

I read your answer last week, but I've changed some things in my program. Please, can you read my code thoroughly to explain me what I'm doing wrong? Everything is all right when I compile it, and I can execute my program, but the values are wrong. How I have to configure the ADC and DMA for save ADC1_Channel16, ADC1_Channel18 and ADC3_Channel7 values in the aADCTripleConvertedValue variable?

Thanks,

Miquel

Posted on October 15, 2013 at 14:32

The values are likely to be a jumbled mess, balance all 3 ADC, make the buffer bigger, ideally much bigger to reduce the interrupt loading.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
raptorhal2
Lead
Posted on October 15, 2013 at 23:42

Channels 16 and 18 require enabling their reference and require a longer ADC Sample Time to be accurate. See the Std Periph. Library for examples.

Channels 16 and 18 are available only on ADC1, so triple mode is probably not the right answer. Since The temperature sensor and VBat don't change rapidly, why not sample all three channels with ADC1?

 The potentiometer channel may also require a longer ADC Sample Time if there is no buffer amplifier.

Cheers, Hal

mmessori
Associate
Posted on November 13, 2013 at 16:47

hello clive1

I'm starting programming using STM32F4 discovery board.

For me is a completely new microcontroller.

At the moment im some problem with multiple scan (triple scan) using NO external trigger but software trigger.

I only found example usimg DMA but they don't work correctly.

I see that you have great competence in Cortex uc.

Can you halp me.

I attached the code.

Thanks in advantage

Marco

________________

Attachments :

clive1.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0zT&d=%2Fa%2F0X0000000bhl%2FXJ4R0pAk.Ilc1sE.4qnq_tKDqtDqUkOVMZgzlUWe63M&asPdf=false
Posted on November 14, 2013 at 03:27

Define ''doesn't work correctly'', what does it do, and what would it do if correct?

The code itself doesn't appear unreasonable.

PA2 is channel 2 (ADC123_IN2), PC2 is channel 12 (ADC123_IN12), which had you thought of using?

Your pin choices would seem to create a lot of conflicts on the STM32F4-Discovery board. Not sure if one could pull 9 analogue inputs.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mmessori
Associate
Posted on November 14, 2013 at 09:01

hi clive1

thanks for your answer.

I not able to trigger conversion using software command without trigger using esternal event.

I wrote code that run with timer trigger (TIM2 for example), but I not able to trigger using manual (sw) trigger.

M