General-purpose I/Os (GPIO)
MODER(i)[1:0]
00
11
1. GP = general-purpose, PP = push-pull, PU = pull-up, PD = pull-down, OD = open-drain, AF = alternate
function.
7.3.1
General-purpose I/O (GPIO)
During and just after reset, the alternate functions are not active and the I/O ports are
configured in input floating mode.
The debug pins are in AF pull-up/pull-down after reset:
•
PA15: JTDI in pull-up
•
PA14: JTCK/SWCLK in pull-down
•
PA13: JTMS/SWDAT in pull-up
•
PB4: NJTRST in pull-up
•
PB3: JTDO in floating state
When the pin is configured as output, the value written to the output data register
(GPIOx_ODR) is output on the I/O pin. It is possible to use the output driver in push-pull
mode or open-drain mode (only the N-MOS is activated when 0 is output).
The input data register (GPIOx_IDR) captures the data present on the I/O pin at every AHB1
clock cycle.
All GPIO pins have weak internal pull-up and pull-down resistors, which can be activated or
not depending on the value in the GPIOx_PUPDR register.
7.3.2
I/O pin multiplexer and mapping
The microcontroller I/O pins are connected to onboard peripherals/modules through a
multiplexer that allows only one peripheral's alternate function (AF) connected to an I/O pin
at a time. In this way, there can be no conflict between peripherals sharing the same I/O pin.
Each I/O pin has a multiplexer with sixteen alternate function inputs (AF0 to AF15) that can
be configured through the GPIOx_AFRL (for pin 0 to 7) and GPIOx_AFRH (for pin 8 to 15)
registers:
•
After reset all I/Os are connected to the system's alternate function 0 (AF0)
•
The peripherals' alternate functions are mapped from AF1 to AF13
•
Cortex
This structure is shown in
178/1328
Table 22. Port bit configuration table
OTYPER(i)
OSPEEDR(i)[B:A] PUPDR(i)[1:0]
x
x
x
x
x
x
x
x
®
-M4 with FPU EVENTOUT is mapped on AF15
Figure
RM0390 Rev 4
x
x
0
x
x
0
x
x
1
x
x
1
x
x
0
x
x
0
x
x
1
x
x
1
19.
(1)
(continued)
I/O configuration
0
Input
1
Input
0
Input
1
Reserved (input floating)
0
Input / output
1
0
Reserved
1
RM0390
Floating
PU
PD
Analog
Need help?
Do you have a question about the STM32F446 Series and is the answer not in the manual?