GPIO electrical characteristics and definitions
A GPIO is five-volt tolerant only if there is no analog function enabled on pin (for I/O
structure FT_a, FT_fa, TT_a). If some analog input function is enabled on the GPIO (ADC
input active, COMP input, OPAMP input), then the maximum operating voltage on pin
cannot exceed min(V
5.3
Five-volt tolerant application examples
The following figures give examples of applications only using five-volt tolerant GPIO.
5.3.1
White LED drive
A white LED needs a typical ~20 mA current under typical 3.5 V supply (4 V max.).
As STM32 devices maximum sink current is 25 mA, there is not enough margin to directly
drive a LED. Two options, using an external MOSFET (or BJT) or driving by means of two
GPIOs, are presented in
V
= 1.8 V or 3.3 V
DD
STM32
GPIO
For the GPIO parallel drive option, open-drain mode must be used and internal pull-up must
be disabled. Since the ground current is huge compared to the MCU consumption, the
ground layout needs to be designed with care.
18/31
, VREF+) + 0.3 V.
DDA
Figure
6.
Figure 6. Example of white LED drive connections
V
= 5 V
DD
AN4899 Rev 3
V
= 1.8 V or 3.3 V
DD
STM32
or
GPIO1
GPIO2
AN4899
V
= 5 V
DD
MSv46877V1
Need help?
Do you have a question about the STM32 and is the answer not in the manual?
Questions and answers