cancel
Showing results for 
Search instead for 
Did you mean: 

ADC + GPDMA output values are incorrect

Hueiyi
Associate II

I am using STM32H563 and using seven pins to read data, all through ADC1 with GPDMA1 Channel0 -2 Words internal FIFO. I connected all seven pins to ground, expecting to get all zeros or values close to zero, but the readings seem to fluctuate randomly.

Although the ADC values do increase when connected to Vcc (>3000) and decrease when connected to ground (<2000), how can I ensure that the readings are correct? Are there any settings that I should adjust?

uint16_t adcbuf[7] = {0};
HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED);
HAL_ADC_Start_DMA(&hadc1, (uint32_t *)adcbuf, 7);

while(1) {
    printf("ADCBUF: ");
    for (int i = 0; i < 7; i++) {
        printf("%d, ", adcbuf[i]);
    }
    printf("\r\n");
    HAL_Delay(1000);
}

 

Hueiyi_0-1770884386090.png

Below is the ADC1 configuration from my .ioc file. (All ranks are configured identically, except for the channel.)

Hueiyi_1-1770884486376.pngHueiyi_2-1770884580706.png

 

Below is the GPDMA1 configuration. (Use Standard Request Mode)

Hueiyi_3-1770884707319.pngHueiyi_4-1770884734337.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Hueiyi
Associate II

Hi TDK, 
I've found the problem—many of my soldered pins appear to have cold solder joints, Vref+ being one of them. By the way, I'm using a Nucleo-H563ZI, so many pins don't have headers. Thanks for your help!

View solution in original post

2 REPLIES 2
TDK
Super User

What board are you using? If custom, please show the schematic. Perhaps VREF+ is not provided or is lacking capacitance or is otherwise unstable.

What pins are you using? Perhaps instead of 7, just choose one for now.

 

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

Hi TDK, 
I've found the problem—many of my soldered pins appear to have cold solder joints, Vref+ being one of them. By the way, I'm using a Nucleo-H563ZI, so many pins don't have headers. Thanks for your help!