cancel
Showing results for 
Search instead for 
Did you mean: 

Hello. I have a question about the correct use of GIPO_Analog. wanted to read this value. I also want to know if the value can vary between 0 to 4095 as when the ADC is used. am I using an MCU that I use Nuclo-F446RE?

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

Hola Breno,

well, I guess by value you mean the value of the ADC reading one of its analog channels which in turn is connected to a GPIO, right?

The ADC can be set to different resolutions between 6...12bit, corresponding to values between 0...63 (6bit) to 0...4095 (12bit). So yes, you will get an ADC value between 0...4095 if you set the ADC to 12bit.

But what does this value stand for?

Well, the ADC needs a reference to compare the measured voltage to it. Due to pin count limitation on your NUCLEO-F446RE, which uses a LQFP-64 package, this reference voltage is connected to the supply voltage of your NUCLEO, i.e. to about 3.3V. Therefore, in your case and with 12bit resolution, the ADC value corresponds to a voltage of: Vgpio = (VALUEadc / (2^12-1)) * VDD

The exact value of VDD is unfortunately unknown or is only estimated, which is why a so-called ratiometric measurement is often carried out. To do this, you need at least a second measurement of a known reference voltage - either the built-in or a high-precision external one.

I'd really recommend to read section 13 of the Reference Manual of the STM32F446, where you will find a detailed decription of the three ADCs of that microcontroller.

In addition you could have a look at some of our video tutorials, e.g.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Good luck!

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
Peter BENSCH
ST Employee

Unfortunately, it is not clear what you are asking for.

Maybe there is some way to use the Google Translator?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Uwe Bonnes
Principal II

It is also a good habit to have a not to long title and the question in the text with surrounding explanation.

my friends, I made the correction, now the idea must be more elaborated

Peter BENSCH
ST Employee

Hola Breno,

well, I guess by value you mean the value of the ADC reading one of its analog channels which in turn is connected to a GPIO, right?

The ADC can be set to different resolutions between 6...12bit, corresponding to values between 0...63 (6bit) to 0...4095 (12bit). So yes, you will get an ADC value between 0...4095 if you set the ADC to 12bit.

But what does this value stand for?

Well, the ADC needs a reference to compare the measured voltage to it. Due to pin count limitation on your NUCLEO-F446RE, which uses a LQFP-64 package, this reference voltage is connected to the supply voltage of your NUCLEO, i.e. to about 3.3V. Therefore, in your case and with 12bit resolution, the ADC value corresponds to a voltage of: Vgpio = (VALUEadc / (2^12-1)) * VDD

The exact value of VDD is unfortunately unknown or is only estimated, which is why a so-called ratiometric measurement is often carried out. To do this, you need at least a second measurement of a known reference voltage - either the built-in or a high-precision external one.

I'd really recommend to read section 13 of the Reference Manual of the STM32F446, where you will find a detailed decription of the three ADCs of that microcontroller.

In addition you could have a look at some of our video tutorials, e.g.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Good luck!

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

@Peter BENSCH​ Thanks for the tip!

I will follow your directions. 😁