Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming Microcontroller GPIO – General Purpose Input/Output

Similar presentations


Presentation on theme: "Programming Microcontroller GPIO – General Purpose Input/Output"— Presentation transcript:

1 Programming Microcontroller GPIO – General Purpose Input/Output
Programming and GPIO 2- 1 Programming Microcontroller GPIO – General Purpose Input/Output Week 1 – Spring Term 2017 32K Byte Burst Flash 64K or 96K Byte SRAM 256K or 512K Byte Burst Flash OTP Mem UART I2C SPI TIM RTC EXT. Bus GPIO USB 2.0FS CAN 2.0B Enet MAC PFQ BC DMA INTR Cntl ARM966E CORE w/DSP 96 MHz CLK Cntl ADC LVD BOD PLL JTAG ETM9

2 A GPIO is a digital binary signal
Definition Programming and GPIO 2- 2 A GPIO is a digital binary signal Its switching level depends on the technology used A GPIO normally is programmable as unconnected, input, output A GPIO might have built-in elements like pull-up, pull-down or ESD (Electrostatic Discharge) devices A GP Output signal is able to sink (or source) a defined amount of current A GP Input has a defined Impedance which might be taken into account if a passive sensor is linked to it A GP Input has a defined hysteresis to avoid "flippering" of the signal "Schmitt Trigger input"

3 STM32F40x Packages STM32F40x are furnished with the following packages
Programming and GPIO STM32F40x Packages 2- 3 STM32F40x are furnished with the following packages LQFP64 (pins) LQFP100 (pins) LQFP144 (pins) LQFP176 (pins) UFBGA176 (ball) WLCSP90 (ball) LQFP176 contains 9 ports with 16 pins Ports are named alphabetically from PA to PI Pins are identified numerically from 0 to 15

4 STM32F40x pin and ball definitions
Programming and GPIO 2- 4 Reference: page 45/185 of “STM32F405xx STM32F407xx” “Datasheet – production data”

5 GPIO pin assignment for peripherals
Programming and GPIO GPIO pin assignment for peripherals 2- 5 Each GPIO pin can be assigned to a given number of peripheral modules Register GPIOx_AFRL & GPIOx_AFRH enable to chose one of the sixteen alternatives Reference: page 272/1745 of “RM0090 Reference manual”

6 GPIO signal flow Reference: page 268/1745 of “RM0090 Reference manual”
Programming and GPIO GPIO signal flow 2- 6 Reference: page 268/1745 of “RM0090 Reference manual”

7 GPIO Configuration Registers
Programming and GPIO 2- 7 GPIOx_MODER – input, output, alternate function or analog mode GPIOx_AFRH & GPIOx_AFRL - one of the sixteen alternate functions GPIOx_OTYPER - push-pull or open drain GPIOx_PUPDR - no pull-up, pull-up or pull-down GPIOx_IDR - input data register GPIOx_ODR - output data register

8 GPIO registers (first part)
Programming and GPIO 2- 8 GPIO registers (first part) Reference Page 286/1745 of “RM0090 Reference manual”

9 GPIO registers (second part)
Programming and GPIO 2- 9 GPIO registers (second part) Reference Page 286/1718 of “RM0090 Reference manual”

10 ARM High performance Bus 1 access (AHB1)
Programming and GPIO 2- 10 Reference Page 71/185 of “STM32F405xx STM32F407xx” “Datasheet – production data”

11 ARM Peripheral Bus 1 access (APB1)
Programming and GPIO 2- 11 ARM Peripheral Bus 1 access (APB1) Reference Page 73/185 of “STM32F405xx STM32F407xx” “Datasheet – production data”

12 ARM Peripheral Bus 2 access (APB2)
Programming and GPIO ARM Peripheral Bus 2 access (APB2) 2- 12 Reference Page 72/185 of “STM32F405xx STM32F407xx” “Datasheet – production data”


Download ppt "Programming Microcontroller GPIO – General Purpose Input/Output"

Similar presentations


Ads by Google