You are on page 1of 8

CpE 187 Embedded Systems

General Purpose Input/Output


Outline
● GPIO Hardware
○ Voltage Levels
○ Terminology
○ Push-Pull vs. Open-drain
● STM32 GPIO Registers
GPIO: Hardware
GPIO: Voltage Levels
GPIO: Configuration Terminology
● High impedance (High-Z, Hi-Z)
○ Influence on the electrical circuit it is connected to.
● Floating pin
○ Unconnected and is also not driven by a circuit inside the integrated circuit.
○ Its voltage level is undefined and unpredictable.
● Pull-up and pull-down resistors
○ Specify logic level (0 or 1) at a floating pin
GPIO: Push-Pull vs Open Drain
STM32 Registers
● GPIO Ports
○ Designated by letters A, B, C, D, and F
○ Number of ports changes between chip families processors
● Each general-purpose I/O port has four 32-bit configuration registers
○ GPIOx_MODER,
○ GPIOx_OTYPER
○ GPIOx_OSPEEDR
○ GPIOx_PUPDR
● Two 32-bit data registers
○ GPIOx_IDR
○ GPIOx_ODR
● 32-bit set/reset register (GPIOx_BSRR)
● 32-bit locking register (GPIOx_LCKR)
● two 32-bit alternate function selection registers
○ GPIOx_AFRH
○ GPIOx_AFRL
Reference
● https://www.st.com/resource/en/reference_manual/rm0316-stm32f303xbcde-stm32f303x68-stm32f328x8-stm32f358
xc-stm32f398xe-advanced-armbased-mcus-stmicroelectronics.pdf

You might also like