AN4899
B
Is the GPIO pin configured as
digital output?
Y
Is the GPIO output connected
to an external floating or to a
high-impedance digital input?
Y
Push-pull output is required.
Select GPIO push-pull
output mode
Select low-speed mode
Pay attention to the GPIO
output current sunk or
sourced by the GPIO pin
Pay attention to the pad
leakage current
C
Is the GPIO pin used as
alternate function?
Select the alternate function
According to the GPIO pin selected
Set the GPIO pin as input or
output following the alternate
function selected
Select push-pull or open-drain
output
Select pull-up / pull-down resistor
Set programming registers of the
dedicated alternate function
Figure 19. GPIO configuration flowchart (2 of 2)
N
N
Is the GPIO output connected
to an external digital input with
pull-up / pull-down input?
Open-drain output is required.
Select GPIO open-drain output
mode
Select low-speed mode
Turn off GPIO pull-up / pull-
down resistor
Check the GPIO output
current sunk or sourced by the
GPIO pin
Pay attention to the pad
leakage current
N
Y
Y
GPIO selection guide and configuration
C
Y
Is the GPIO pin used as
analog function?
Y
Analog.
Set GPIO pin as analog function
Set the analog function selected
AN4899 Rev 3
A
External output stage must be
analyzed.
The GPIO is connected to a
specific hardware output which
can require Hi-Z input, input
with pull-up / pull-down resistor,
or even an adaptation interface.
N
External input stage must be
analyzed.
The external input stage
connected to the GPIO must be
analyzed since the GPIO is
connected to a specific
hardware input which can
require either a push-pull or an
open-drain GPIO output.
N
End of flow
MSv46890V1
29/31
30
Need help?
Do you have a question about the STM32 and is the answer not in the manual?