SlideShare a Scribd company logo
超威猛應⽤用輔具特⼯工隊! 
STM32F407 硬體週邊介 
紹 
⺩王尹⾠辰(JackABK) 
2014/09/04 
abkabkabkyes@gmail.com
GPIO
GPIO(General Purpose 
Input/Output) 
• GPIO is a generic pin on a chip whose 
behavior ! 
including whether it is an input or output pin) 
can be controlled (programmed) by the user 
at run time.
GPIO Input 
• Floating 
unknown voltage input stage 
• Pull-up 
connect to high voltage 
• Pull-down 
connected to ground
Input configuration
GPIO Output 
• push pull 
pull-up 
pull-down 
• open-drain 
pull-up 
pull-downPull-down
Output configuration
Setting GPIO pins 
• You can configure on the corresponding peripheral: 
Speed 
Mode 
Type 
Pull up/pull down resistors
Setting GPIO pins 
• On the STM32F4xx the GPIO ports are connected 
to the AHB1 bus 
• Enabling the clock:
Setting GPIO pins 
• The GPIO’s clock can be anything of the following: 
• GPIO_Speed_2MHz 
GPIO_Speed_25MHz 
GPIO_Speed_50MHz 
GPIO_Speed_100MHz
Setting GPIO pins 
• On the STM32F4 the GPIO can have up to 4 modes 
GPIO_Mode_OUT for digital output 
GPIO_Mode_IN for digital input 
GPIO_Mode_AN for analog input 
GPIO_Mode_AF for the alternate functions (like 
SPI, I²C, USART, …)
Setting GPIO pins 
• For the gpio output, The type indicates the 
hardware configuration of the pin which can be: 
GPIO_OType_PP, ! 
• a push-pull is driving the output 
GPIO_OType_OD! 
• the output is open-drain
Setting GPIO pins 
•Next we can configure pull up, pull down 
resistors or nothing at all for each pin:! 
•GPIO_PuPd_NOPULL 
no resistor connected 
•GPIO_PuPd_UP 
pin is connected to a pull up resistor 
•GPIO_PuPd_DOWN 
pin is connect to a pull down resistor
Setting GPIO pins 
The resistors value of Pull-up and Pull-down
Setting GPIO pins 
•A complete of code to set the gpio 
pin:
Interrupt
Interrupt Structure
Interrupt Structure
Interrupt handler 
• On way to achieve this goal consists in the creation of 
tasks waiting for an interrupt to occur with a semaphore. 
! 
• Let this safer portion of code actually handle the interrupt. 
An ISR “gives” a semaphore and unblock a ’Handler” 
task that is able to handler the ISR, making the ISR 
execution much shorter
Nested Vectored Interrupt 
Controller (NVIC) 
• Depending on the implementation used by the 
silicon manufacturer. 
• The NVIC can support up to 240 external 
interrupts with up to 256 different priority levels(0 
to 255) that can be dynamically reprioritized. 
PreemptionPriority: 4bits 
SubPriority: 4bits
External Interrupt(EXTI) 
•Before settings EXTI, You must be: 
connected from GPIO 
settings EXTI 
設定哪條Line 
• Interrupt mode 
• interrupt condition?(Rising, Falling, Rising&falling ) 
• LineCmd( ENABLE is open,DISABLE is close.) 
settings NVIC 
• IRQ_Channel 
• PreemptionPriority and SubPriority 
• ChannelCmd
External Interrupt(EXTI)
External Interrupt(EXTI) 
The hardware of controller EXTI 
(blue boxes are registers, red dots are input pins)
External Interrupt(EXTI) 
for example
Ref. 
! 
• STM32F4 GPIO Configuration 
• NCKU wiki 
• Interrupts & ports
Thanks!

More Related Content

PPTX
[5]投影片 futurewad樹莓派研習會 141218
PPT
FT232R USB to Serial UART Bridge
PPT
Switch & LED using TMS320C6745 DSP
PPT
Led blinking using TMS320C6745
PDF
Linmot overzicht servo_controller_serie_e1100_duits_4_mb
PPT
Interfacing UART with tms320C6745
PPTX
Arduino 習作工坊 - Lesson 1 燈光之夜
[5]投影片 futurewad樹莓派研習會 141218
FT232R USB to Serial UART Bridge
Switch & LED using TMS320C6745 DSP
Led blinking using TMS320C6745
Linmot overzicht servo_controller_serie_e1100_duits_4_mb
Interfacing UART with tms320C6745
Arduino 習作工坊 - Lesson 1 燈光之夜

What's hot (17)

PPTX
Aditech innodisk-flash disk technology
PDF
Mitsubishi inverter catalog-fr-e700-mitsubishi dienhathe.vn
PDF
AWS VPC by hellocloud.io
PDF
Catalog inverter family Mitsubishi Electric-Beeteco.com
PDF
Ls catalog thiet bi tu dong i s7_e_1104_dienhathe.vn
PDF
U8638manual
PDF
6to4tunnel sample config
PDF
MYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
PPT
Quest technology product training 8 13-14
PDF
Catalog Biến tần FVR Micro Fuji Electric-Beeteco.com
PDF
ELC North America 2021 Introduction to pin muxing and gpio control under linux
PDF
Compact logix1769l32 l35-
PDF
CODE BLUE 2014 : A security assessment study and trial of Tricore-powered aut...
PDF
Iai scon controller_specsheet
PDF
ds188-XA-Zynq-7000-Overview
PDF
VltFC 102 hvac drive operating instructions
Aditech innodisk-flash disk technology
Mitsubishi inverter catalog-fr-e700-mitsubishi dienhathe.vn
AWS VPC by hellocloud.io
Catalog inverter family Mitsubishi Electric-Beeteco.com
Ls catalog thiet bi tu dong i s7_e_1104_dienhathe.vn
U8638manual
6to4tunnel sample config
MYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
Quest technology product training 8 13-14
Catalog Biến tần FVR Micro Fuji Electric-Beeteco.com
ELC North America 2021 Introduction to pin muxing and gpio control under linux
Compact logix1769l32 l35-
CODE BLUE 2014 : A security assessment study and trial of Tricore-powered aut...
Iai scon controller_specsheet
ds188-XA-Zynq-7000-Overview
VltFC 102 hvac drive operating instructions
Ad

Viewers also liked (8)

PDF
How to debug mruby (rubyconftw2014)
PDF
STM32F4 for 智慧型電動輪椅系統Part1
PPTX
Apache Storm and twitter Streaming API integration
PPT
第三章Ti msp430平台介紹 v3
PPTX
Densebox
PPTX
présentation STM32
PPT
PPTX
艾鍗學院-單晶片韌體-CC2500通訊實驗
How to debug mruby (rubyconftw2014)
STM32F4 for 智慧型電動輪椅系統Part1
Apache Storm and twitter Streaming API integration
第三章Ti msp430平台介紹 v3
Densebox
présentation STM32
艾鍗學院-單晶片韌體-CC2500通訊實驗
Ad

Similar to Stm32f4硬體週邊介紹 (20)

PDF
PPTX
Part-1 : Mastering microcontroller with embedded driver development
PDF
Hardware interfacing basics using AVR
PDF
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
PPTX
F9 microkernel app development part 2 gpio meets led
PDF
Ins and Outs of GPIO Programming
 
PPTX
Brain wave controlled robot
DOCX
Arm7 Interfacing examples
PPT
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
PPTX
General Purpose Input Output - Brief Introduction
PDF
ESD Lab1
PDF
Nrf24l01 tutorial 0
PPTX
How to use peripherals on MCB1700
PDF
PDF
lesson2 - Nodemcu course - NodeMCU dev Board
PDF
Embedded Systems: Lecture 9: The Pi Control ARM
PDF
Atomic PI apug
PDF
Atomic pi Mini PC
DOC
Gesture based vehicle movements control and alerting system docu
Part-1 : Mastering microcontroller with embedded driver development
Hardware interfacing basics using AVR
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
F9 microkernel app development part 2 gpio meets led
Ins and Outs of GPIO Programming
 
Brain wave controlled robot
Arm7 Interfacing examples
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
General Purpose Input Output - Brief Introduction
ESD Lab1
Nrf24l01 tutorial 0
How to use peripherals on MCB1700
lesson2 - Nodemcu course - NodeMCU dev Board
Embedded Systems: Lecture 9: The Pi Control ARM
Atomic PI apug
Atomic pi Mini PC
Gesture based vehicle movements control and alerting system docu

Recently uploaded (20)

PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Geodesy 1.pptx...............................................
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
Construction Project Organization Group 2.pptx
PPT
Mechanical Engineering MATERIALS Selection
PPTX
web development for engineering and engineering
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
R24 SURVEYING LAB MANUAL for civil enggi
Lecture Notes Electrical Wiring System Components
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Sustainable Sites - Green Building Construction
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
UNIT 4 Total Quality Management .pptx
Operating System & Kernel Study Guide-1 - converted.pdf
Geodesy 1.pptx...............................................
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Automation-in-Manufacturing-Chapter-Introduction.pdf
Construction Project Organization Group 2.pptx
Mechanical Engineering MATERIALS Selection
web development for engineering and engineering
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd

Stm32f4硬體週邊介紹

  • 1. 超威猛應⽤用輔具特⼯工隊! STM32F407 硬體週邊介 紹 ⺩王尹⾠辰(JackABK) 2014/09/04 abkabkabkyes@gmail.com
  • 3. GPIO(General Purpose Input/Output) • GPIO is a generic pin on a chip whose behavior ! including whether it is an input or output pin) can be controlled (programmed) by the user at run time.
  • 4. GPIO Input • Floating unknown voltage input stage • Pull-up connect to high voltage • Pull-down connected to ground
  • 6. GPIO Output • push pull pull-up pull-down • open-drain pull-up pull-downPull-down
  • 8. Setting GPIO pins • You can configure on the corresponding peripheral: Speed Mode Type Pull up/pull down resistors
  • 9. Setting GPIO pins • On the STM32F4xx the GPIO ports are connected to the AHB1 bus • Enabling the clock:
  • 10. Setting GPIO pins • The GPIO’s clock can be anything of the following: • GPIO_Speed_2MHz GPIO_Speed_25MHz GPIO_Speed_50MHz GPIO_Speed_100MHz
  • 11. Setting GPIO pins • On the STM32F4 the GPIO can have up to 4 modes GPIO_Mode_OUT for digital output GPIO_Mode_IN for digital input GPIO_Mode_AN for analog input GPIO_Mode_AF for the alternate functions (like SPI, I²C, USART, …)
  • 12. Setting GPIO pins • For the gpio output, The type indicates the hardware configuration of the pin which can be: GPIO_OType_PP, ! • a push-pull is driving the output GPIO_OType_OD! • the output is open-drain
  • 13. Setting GPIO pins •Next we can configure pull up, pull down resistors or nothing at all for each pin:! •GPIO_PuPd_NOPULL no resistor connected •GPIO_PuPd_UP pin is connected to a pull up resistor •GPIO_PuPd_DOWN pin is connect to a pull down resistor
  • 14. Setting GPIO pins The resistors value of Pull-up and Pull-down
  • 15. Setting GPIO pins •A complete of code to set the gpio pin:
  • 19. Interrupt handler • On way to achieve this goal consists in the creation of tasks waiting for an interrupt to occur with a semaphore. ! • Let this safer portion of code actually handle the interrupt. An ISR “gives” a semaphore and unblock a ’Handler” task that is able to handler the ISR, making the ISR execution much shorter
  • 20. Nested Vectored Interrupt Controller (NVIC) • Depending on the implementation used by the silicon manufacturer. • The NVIC can support up to 240 external interrupts with up to 256 different priority levels(0 to 255) that can be dynamically reprioritized. PreemptionPriority: 4bits SubPriority: 4bits
  • 21. External Interrupt(EXTI) •Before settings EXTI, You must be: connected from GPIO settings EXTI 設定哪條Line • Interrupt mode • interrupt condition?(Rising, Falling, Rising&falling ) • LineCmd( ENABLE is open,DISABLE is close.) settings NVIC • IRQ_Channel • PreemptionPriority and SubPriority • ChannelCmd
  • 23. External Interrupt(EXTI) The hardware of controller EXTI (blue boxes are registers, red dots are input pins)
  • 25. Ref. ! • STM32F4 GPIO Configuration • NCKU wiki • Interrupts & ports