cancel
Showing results for 
Search instead for 
Did you mean: 

How can GPIO pins output voltage be equal to VDD/VDDA or 0V(GND)?

kevin1078
Associate II
Posted on April 08, 2015 at 10:15

Hi all,

I want to use STM32L100's two GPIO pins to output high voltage as equal to VDD/VDDA and low voltage as equal to 0V(GND) for, say, two series resistors R1 and R2, and use ADC to measure one's voltage. However, I noticed that in STM32L100's datasheet, it mentioned that GPIO output voltage may not reach as high as VDD/VDDA, and not as low as GND, especially when outputting high current. This definitely will influence the voltage measured by ADC. Could anyone help to point out how GPIO can output a voltage as high as VDD/VDDA, and as low as GND? I looked up the datasheet and user manual, but found no clear answer. Thanks a lot for the help!

Best regards,

Kevin Kong

#adc #gpio #stm32l100
4 REPLIES 4
Danish1
Lead II
Posted on April 08, 2015 at 14:51

There is no magic here.

When you tell the output to be Vdd, you turn on a MOS transistor that connects the output to the Vdd pin.

MOS transistors have a certain effective resistance when turned on.

So if you draw current from the pin, there will be a voltage-drop across this resistance.

The pin will never reach Vdd if you are drawing any current. But it might get ''close enough'' if you are drawing a ''low enough'' current.

If that is not good enough for your design, you need to consider high-current buffering.

AvaTar
Lead
Posted on April 08, 2015 at 15:59

The pin will never reach Vdd if you are drawing any current.

 

And neither do you reach zero volt, if any current flows into the port.

For a push-pull configuration (''totem-pole''), you measure a difference of RDS(on) * Iout to the rails on the pin.

kevin1078
Associate II
Posted on April 09, 2015 at 07:09

Hi Danish, now I see. Thank you! And I have no idea about high-current buffering, so before I would ask any question, I decided to get familiar with it by google.

kevin1078
Associate II
Posted on April 09, 2015 at 07:26

Hi argentum, thank you for the reply! How can I know how much RDS(on) is? I couldn't find any clear information in STM32L100's datasheet and user manual.  I can only conclude that its value is about 50~65Ω  from the Output voltage characteristics in STM32L100's datasheet, by the voltage drop and the IO current(V

OL

is 0.4V at maximum when I

IO

is 8mA; V

OH

is V

DD

-1.3 when I

IO

is 20mA). How can I know its detail range? Does ST mention this in any document?