cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-H745ZI-Q ADC problems.

AMilo.1
Associate II

Hello everyone!

First of all, my apologies if I ask the question wrong or don't provide enough information to start with, I'll of course send all that is needed for better solving of this problem.

So, I've gotten the mentioned board and I need to do some measurements with the on-board ADC. I've noticed a problem that my results are shifted by a fixed offset . So when I connect my ADC pin to AGND I see the result 31 for ADC1 channel 2, and the result of 511 for ADC2 channel 11.

What I've done so far: Check what is connected to where in the schematic and all appears to be ok.

Try Automati Self Callibration (no luck there)

Check for linearity betwen GND and VDDA (It moves quite linear from 511 to 1023).

My question is what could be causing this and how can I fix it.

5 REPLIES 5
AMilo.1
Associate II
DFuchs
Associate III

Hi,

did you measure the voltage at that pin with a multimeter?

Is anything connected to that pin and is the pin configured correctly?

Kind regards

Daniel

AMilo.1
Associate II

Hi,

I've directly grounded it with a jumper wire, so the pin is ad AGND potential.

The pin itself (PF11 used in ADC1_INP2) is not connected to anything according to the schematic. The configuration is done through STM32CubeMX and I believe it is correctly configured.

I've also tried to set VREFBUF Mode to Internal voltage reference, but no luck with that either.

Kind regards,

Anton

TDK
Guru

> So when I connect my ADC pin to AGND I see the result 31 for ADC1 channel 2, and the result of 511 for ADC2 channel 11.

The code you linked only initialized ADC2. ADC1 is not initialized.

The ADCs have options to left-shift the result a number of bits. Might be what is happening here.

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

Yes, but I meant to say that I tried both. Now, I think I've figured it out. I used pin PC1 as a analog input, but somehow I've missed the fact that it cannot be used for that on this board by default since it is connected to the Ethernet controller. And for my ADC1 calibration I did something wrong, but I've figured it out.

To get accurate results for your ADC you need to calibrate it using the HAL_ADCEx_Calibration_Start function and make sure that the pin you use as a analog input isn't connected to something else. I never had to use the calibration function before on other discovery and nucleo boards, but maybe that is because i use the SMPS as the main MCU power supply.

And as a bonus, I'll be using an external voltage reference just for kicks.