cancel
Showing results for 
Search instead for 
Did you mean: 

Noisy ADC measures on shunt for L6206PD

zhivko zivkovic
Associate III
Posted on November 02, 2017 at 14:22

I am seeing very noisy measurements on shunt adc.

I attached schematics and gerbers.

Could suggest how to eliminate noise on adc lines (line connected to shunt and going to STM32F303 chip?

regards

#adc #l6206pd #noise
12 REPLIES 12
zhivko zivkovic
Associate III
Posted on November 25, 2017 at 23:05

ADC values are here, but it is funny how they difference of one measurement to another is quite big - could it be that they are indeed correct or possible, or it is some flaw in my program?

I am using:

hadc3.Init.Resolution = ADC_RESOLUTION_12B;

and

sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5;

Should I use half word, or word in dma alignment?

hdma_adc3.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;

0690X00000608wSQAQ.png
Posted on November 26, 2017 at 02:04

OK found the mistake... I was using,

hadc1.Init.DataAlign = ADC_DATAALIGN_LEFT;

instead

hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;

Also I found out that using:

        hdma_adc1.Init.MemDataAlignment = DMA_PDATAALIGN_HALFWORD;

is OK.

Now I got reasonable results, thanks for all help, there is a code under git link I post above - maybe it helps somebody.

Posted on November 28, 2017 at 13:32

Hi, you did a great job.

To be honest the second part of your issue (coordinating the timer, ADC and push everything into the RAM trough DMA) was a bit above my coding skills

🙂

 .