Skip to main content
Graduate II
December 17, 2023
Solved

Reading data by ADC using DMA is not working Poreperly

  • December 17, 2023
  • 3 replies
  • 1688 views

I am trying to read some data by ADC using DMA transfer method I configured the ADC  
 attached the code below

I cannot getting the ADC value in all buffer only  read the 3rd  buffer 

1st and second buffer shows grabage value 

please help me 

i tried out changing the sample value and clock prescaler 

My cpu speed is 14Mhz and also to the ADC is 14Mhz1.jpg

 

 

    This topic has been closed for replies.
    Best answer by TDK

    Because you defined it as uint32_t and not uint16_t.

    3 replies

    Super User
    December 17, 2023

    Your ADC buffer should be uint16_t values, not uint32_t values.

    The first two buffer values are two concatenated uint16_t's

    268374015 = 0x0FFF0FFF

    Graduate II
    December 17, 2023

    Thanks very much 

    Why the 3,4 and 5 buffers are not filled ?

    TDKAnswer
    Super User
    December 17, 2023

    Because you defined it as uint32_t and not uint16_t.

    Graduate II
    December 18, 2023

    Tanks worked