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

What's hot

Fu9000 a manual
Fu9000 a manual Fu9000 a manual
Aditech innodisk-flash disk technology
Aditech innodisk-flash disk technologyAditech innodisk-flash disk technology
Aditech innodisk-flash disk technologyVilas Fulsundar
 
Mitsubishi inverter catalog-fr-e700-mitsubishi dienhathe.vn
Mitsubishi inverter catalog-fr-e700-mitsubishi dienhathe.vnMitsubishi inverter catalog-fr-e700-mitsubishi dienhathe.vn
Mitsubishi inverter catalog-fr-e700-mitsubishi dienhathe.vn
Dien Ha The
 
AWS VPC by hellocloud.io
AWS VPC by hellocloud.ioAWS VPC by hellocloud.io
AWS VPC by hellocloud.io
Hello Cloud
 
Catalog inverter family Mitsubishi Electric-Beeteco.com
Catalog inverter family Mitsubishi Electric-Beeteco.comCatalog inverter family Mitsubishi Electric-Beeteco.com
Catalog inverter family Mitsubishi Electric-Beeteco.com
Beeteco
 
Ls catalog thiet bi tu dong i s7_e_1104_dienhathe.vn
Ls catalog thiet bi tu dong i s7_e_1104_dienhathe.vnLs catalog thiet bi tu dong i s7_e_1104_dienhathe.vn
Ls catalog thiet bi tu dong i s7_e_1104_dienhathe.vn
Dien Ha The
 
6to4tunnel sample config
6to4tunnel sample config6to4tunnel sample config
6to4tunnel sample config
jebong03
 
MYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
MYS-6ULX Single Board Computer for Industry 4.0 and IoT ApplicationsMYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
MYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
Linda Zhang
 
Quest technology product training 8 13-14
Quest technology product training 8 13-14Quest technology product training 8 13-14
Quest technology product training 8 13-14
QuestTechnologyIntl
 
Catalog Biến tần FVR Micro Fuji Electric-Beeteco.com
Catalog Biến tần FVR Micro Fuji Electric-Beeteco.comCatalog Biến tần FVR Micro Fuji Electric-Beeteco.com
Catalog Biến tần FVR Micro Fuji Electric-Beeteco.com
Beeteco
 
ELC North America 2021 Introduction to pin muxing and gpio control under linux
ELC  North America 2021 Introduction to pin muxing and gpio control under linuxELC  North America 2021 Introduction to pin muxing and gpio control under linux
ELC North America 2021 Introduction to pin muxing and gpio control under linux
Neil Armstrong
 
Compact logix1769l32 l35-
Compact logix1769l32 l35-Compact logix1769l32 l35-
Compact logix1769l32 l35-
Steven Qi
 
CODE BLUE 2014 : A security assessment study and trial of Tricore-powered aut...
CODE BLUE 2014 : A security assessment study and trial of Tricore-powered aut...CODE BLUE 2014 : A security assessment study and trial of Tricore-powered aut...
CODE BLUE 2014 : A security assessment study and trial of Tricore-powered aut...
CODE BLUE
 
Iai scon controller_specsheet
Iai scon controller_specsheetIai scon controller_specsheet
Iai scon controller_specsheet
Electromate
 
ds188-XA-Zynq-7000-Overview
ds188-XA-Zynq-7000-Overviewds188-XA-Zynq-7000-Overview
ds188-XA-Zynq-7000-OverviewAngela Suen
 
VltFC 102 hvac drive operating instructions
VltFC 102  hvac drive  operating instructionsVltFC 102  hvac drive  operating instructions
VltFC 102 hvac drive operating instructions
Toàn Huỳnh
 

What's hot (17)

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

Viewers also liked

How to debug mruby (rubyconftw2014)
How to debug mruby (rubyconftw2014)How to debug mruby (rubyconftw2014)
How to debug mruby (rubyconftw2014)
yamanekko
 
STM32F4 for 智慧型電動輪椅系統Part1
STM32F4 for 智慧型電動輪椅系統Part1STM32F4 for 智慧型電動輪椅系統Part1
STM32F4 for 智慧型電動輪椅系統Part1
Jack Wang
 
Apache Storm and twitter Streaming API integration
Apache Storm and twitter Streaming API integrationApache Storm and twitter Streaming API integration
Apache Storm and twitter Streaming API integration
Uday Vakalapudi
 
第三章Ti msp430平台介紹 v3
第三章Ti msp430平台介紹 v3第三章Ti msp430平台介紹 v3
第三章Ti msp430平台介紹 v3
冠宇 陳
 
Densebox
DenseboxDensebox
Densebox
冠宇 陳
 
présentation STM32
présentation STM32présentation STM32
présentation STM32
hatem ben tayeb
 
艾鍗學院-單晶片韌體-CC2500通訊實驗
艾鍗學院-單晶片韌體-CC2500通訊實驗艾鍗學院-單晶片韌體-CC2500通訊實驗
艾鍗學院-單晶片韌體-CC2500通訊實驗
艾鍗科技
 

Viewers also liked (8)

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

Similar to Stm32f4硬體週邊介紹

PPT+.pdf
PPT+.pdfPPT+.pdf
Input-Output Interfacing for LED and Switch
Input-Output Interfacing for LED and SwitchInput-Output Interfacing for LED and Switch
Input-Output Interfacing for LED and Switch
RanaKhizar7
 
Part-1 : Mastering microcontroller with embedded driver development
Part-1 : Mastering microcontroller with embedded driver development Part-1 : Mastering microcontroller with embedded driver development
Part-1 : Mastering microcontroller with embedded driver development
FastBit Embedded Brain Academy
 
Embedded Systems: Lecture 9: The Pi Control ARM
Embedded Systems: Lecture 9: The Pi Control ARMEmbedded Systems: Lecture 9: The Pi Control ARM
Embedded Systems: Lecture 9: The Pi Control ARM
Ahmed El-Arabawy
 
Java Webinar #9: “Raspberry Pi Platform for Java Programmers”
Java Webinar #9: “Raspberry Pi Platform for Java Programmers”Java Webinar #9: “Raspberry Pi Platform for Java Programmers”
Java Webinar #9: “Raspberry Pi Platform for Java Programmers”
GlobalLogic Ukraine
 
Atomic pi Mini PC
Atomic pi Mini PCAtomic pi Mini PC
Atomic pi Mini PC
Dwika Sudrajat
 
Atomic PI apug
Atomic PI apugAtomic PI apug
Atomic PI apug
Dwika Sudrajat
 
F9 microkernel app development part 2 gpio meets led
F9 microkernel app development part 2 gpio meets ledF9 microkernel app development part 2 gpio meets led
F9 microkernel app development part 2 gpio meets led
Benux Wei
 
Analog, IO Test Chip Validation
Analog,  IO Test Chip  ValidationAnalog,  IO Test Chip  Validation
Analog, IO Test Chip ValidationSMIT A. PATEL
 
Dell Cctk support for newly added bios tokens
Dell Cctk support for newly added bios tokensDell Cctk support for newly added bios tokens
Dell Cctk support for newly added bios tokens
artisriva
 
Lecture on PIC-1.pptx
Lecture on PIC-1.pptxLecture on PIC-1.pptx
Lecture on PIC-1.pptx
godfrey35
 
Ins and Outs of GPIO Programming
Ins and Outs of GPIO ProgrammingIns and Outs of GPIO Programming
Ins and Outs of GPIO Programming
ICS
 
plc_training_manual.pdf
plc_training_manual.pdfplc_training_manual.pdf
plc_training_manual.pdf
MarioHaguila
 
Keysight Mini-ICT - Testing Days México
Keysight Mini-ICT - Testing Days MéxicoKeysight Mini-ICT - Testing Days México
Keysight Mini-ICT - Testing Days México
Interlatin
 
Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVR
Mohamed Abdallah
 
CPLD xc9500
CPLD xc9500CPLD xc9500
CPLD xc9500
A B Shinde
 
Mitsubishi inverter freqrol-f700 series dienhathe.vn
Mitsubishi inverter freqrol-f700 series dienhathe.vnMitsubishi inverter freqrol-f700 series dienhathe.vn
Mitsubishi inverter freqrol-f700 series dienhathe.vn
Dien Ha The
 
Mitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 seriesMitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 series
Dien Ha The
 
Mitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 seriesMitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 series
Dien Ha The
 

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

PPT+.pdf
PPT+.pdfPPT+.pdf
PPT+.pdf
 
Input-Output Interfacing for LED and Switch
Input-Output Interfacing for LED and SwitchInput-Output Interfacing for LED and Switch
Input-Output Interfacing for LED and Switch
 
Part-1 : Mastering microcontroller with embedded driver development
Part-1 : Mastering microcontroller with embedded driver development Part-1 : Mastering microcontroller with embedded driver development
Part-1 : Mastering microcontroller with embedded driver development
 
Embedded Systems: Lecture 9: The Pi Control ARM
Embedded Systems: Lecture 9: The Pi Control ARMEmbedded Systems: Lecture 9: The Pi Control ARM
Embedded Systems: Lecture 9: The Pi Control ARM
 
PPT+.pdf
PPT+.pdfPPT+.pdf
PPT+.pdf
 
Java Webinar #9: “Raspberry Pi Platform for Java Programmers”
Java Webinar #9: “Raspberry Pi Platform for Java Programmers”Java Webinar #9: “Raspberry Pi Platform for Java Programmers”
Java Webinar #9: “Raspberry Pi Platform for Java Programmers”
 
Atomic pi Mini PC
Atomic pi Mini PCAtomic pi Mini PC
Atomic pi Mini PC
 
Atomic PI apug
Atomic PI apugAtomic PI apug
Atomic PI apug
 
F9 microkernel app development part 2 gpio meets led
F9 microkernel app development part 2 gpio meets ledF9 microkernel app development part 2 gpio meets led
F9 microkernel app development part 2 gpio meets led
 
Analog, IO Test Chip Validation
Analog,  IO Test Chip  ValidationAnalog,  IO Test Chip  Validation
Analog, IO Test Chip Validation
 
Dell Cctk support for newly added bios tokens
Dell Cctk support for newly added bios tokensDell Cctk support for newly added bios tokens
Dell Cctk support for newly added bios tokens
 
Lecture on PIC-1.pptx
Lecture on PIC-1.pptxLecture on PIC-1.pptx
Lecture on PIC-1.pptx
 
Ins and Outs of GPIO Programming
Ins and Outs of GPIO ProgrammingIns and Outs of GPIO Programming
Ins and Outs of GPIO Programming
 
plc_training_manual.pdf
plc_training_manual.pdfplc_training_manual.pdf
plc_training_manual.pdf
 
Keysight Mini-ICT - Testing Days México
Keysight Mini-ICT - Testing Days MéxicoKeysight Mini-ICT - Testing Days México
Keysight Mini-ICT - Testing Days México
 
Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVR
 
CPLD xc9500
CPLD xc9500CPLD xc9500
CPLD xc9500
 
Mitsubishi inverter freqrol-f700 series dienhathe.vn
Mitsubishi inverter freqrol-f700 series dienhathe.vnMitsubishi inverter freqrol-f700 series dienhathe.vn
Mitsubishi inverter freqrol-f700 series dienhathe.vn
 
Mitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 seriesMitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 series
 
Mitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 seriesMitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 series
 

Recently uploaded

PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
bhadouriyakaku
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
RicletoEspinosa1
 
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptxTOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
nikitacareer3
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 

Recently uploaded (20)

PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
 
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptxTOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 

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