Skip to main content
kchin.2
Associate II
August 7, 2023
Question

ADC dma without loseing samples

Hi ,

i am using adc dma multibuffer mode and first buff =1000 seconf buff =1000

after getting completed call back i am switching the buffer and starting multidma_buffer again but in this case i am lossing some data when i processing completed call back .

is there any way to get adc_dma data without losing for 5sec . per sec i will get 100000 samples

can anyone please help me on this.

    This topic has been closed for replies.

    4 replies

    waclawek.jan
    Super User
    August 7, 2023

    Use circular DMA.

    JW

    kchin.2
    kchin.2Author
    Associate II
    August 8, 2023

    kchin2_0-1691462987635.png

    after configuring adc dma in circular mode we are still getting the missing samples from adc

    LCE
    Principal III
    August 8, 2023

    The picture you are showing doesn't help us as long as we don't know how data should look...

    Which STM32? ADC setup? DMA setup?

    > 5sec . per sec i will get 100000 samples

    Do you mean you want to collect data over 5 seconds with 100 kHz sampling rate?
    You might run out of internal RAM...

    KnarfB
    Super User
    August 8, 2023

    Your problem description is very vague, missing important facts as @LCE already pointed out. Show code snippets, give detailed observations. IMHO you didn't loose samples,the curve looks smooth but interspersed with periods of 0.

    If one half of each buffer stays 0 (as I concluded from the diagram), or every other buffer, you may be a factor of 2 off in some settings, like providing the length in bytes where the length in samples was expected or such.

    hth

    KnarfB