Skip to main content
thannara123
Associate III
December 17, 2023
Solved

Reading data by ADC using DMA is not working Poreperly

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.
TDK
TDKBest answer
December 17, 2023

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""."

4 replies

TDK
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

"If you feel a post has answered your question, please click ""Accept as Solution""."
thannara123
Associate III
December 17, 2023

Thanks very much 

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

TDK
TDKBest answer
December 17, 2023

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
Associate III
December 18, 2023

Tanks worked