STM32H735G-DK ADC accuracy
Hello.
I'm using the STM32H735G-DK and I run into a problem when using the ADC, so I made a very short CubeMX project to check this.
I started with a CubeMX configured board with no peripheral default initialisation.
Then I ticked ADC1 IN0. So by default it set it as 16bits conversion with software start. I changed the CPU clock to 550MHz.
In the generated project:
- I'm starting the ADC conversion
- Then I poll for the conversion completion
- Then I read the ADC result and store it
HAL_ADC_Start(&hadc1);
HAL_StatusTypeDef status = HAL_ADC_PollForConversion(&hadc1, 1000);
adc_buff = HAL_ADC_GetValue(&hadc1);
The default pinout use the Arduino A2 pin (PA0_C). I connected the 3.3V on the ADC input. The ADC result is then 65535 which is fine. What is strange is that it doesn't change of a single lsb due to noise.
Then I connected the 0V on the ADC input. The result I get is 1000+-100lsb instead of 0.
Which basically mean that on a 16bit conversion, I have 10bits of noise.
- I checked that the channel is set to single-ended
- I checked that VDDA and GNDA are set to 3.3V and 0V.
- I tried ADC2 instead
- I tried ADC2 with another pin
- I tried to slow the ADC clock down to 1MHz
But it still give me a huge offset. How to get rid of this?
The most unfortunate thing is that the audio recording is already not working, see
So I'm using the ADC instead and I run into that terrible effect.
Best regards