cancel
Showing results for 
Search instead for 
Did you mean: 

Reading data by ADC using DMA is not working Poreperly

thannara123
Senior

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Because you defined it as uint32_t and not uint16_t.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
TDK
Guru

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

If you feel a post has answered your question, please click "Accept as Solution".
thannara123
Senior

Thanks very much 

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

Because you defined it as uint32_t and not uint16_t.

If you feel a post has answered your question, please click "Accept as Solution".
thannara123
Senior

Tanks worked