2015-04-08 01:15 AM
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 #stm32l1002015-04-08 05:51 AM
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.2015-04-08 06:59 AM
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.
2015-04-08 10:09 PM
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.
2015-04-08 10:26 PM
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 IIO
is 8mA; VOH
is VDD
-1.3 when IIO
is 20mA). How can I know its detail range? Does ST mention this in any document?