SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
超威猛應⽤用輔具特⼯工隊! 
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!

Weitere ähnliche Inhalte

Was ist angesagt?

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.vnDien Ha The
 
AWS VPC by hellocloud.io
AWS VPC by hellocloud.ioAWS VPC by hellocloud.io
AWS VPC by hellocloud.ioHello 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.comBeeteco
 
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.vnDien Ha The
 
6to4tunnel sample config
6to4tunnel sample config6to4tunnel sample config
6to4tunnel sample configjebong03
 
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 ApplicationsLinda 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-14QuestTechnologyIntl
 
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.comBeeteco
 
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 linuxNeil 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_specsheetElectromate
 
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 instructionsToàn Huỳnh
 

Was ist angesagt? (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
 

Andere mochten auch

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 智慧型電動輪椅系統Part1Jack 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 integrationUday Vakalapudi
 
第三章Ti msp430平台介紹 v3
第三章Ti msp430平台介紹 v3第三章Ti msp430平台介紹 v3
第三章Ti msp430平台介紹 v3冠宇 陳
 
艾鍗學院-單晶片韌體-CC2500通訊實驗
艾鍗學院-單晶片韌體-CC2500通訊實驗艾鍗學院-單晶片韌體-CC2500通訊實驗
艾鍗學院-單晶片韌體-CC2500通訊實驗艾鍗科技
 

Andere mochten auch (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通訊實驗
 

Ähnlich wie Stm32f4硬體週邊介紹

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 SwitchRanaKhizar7
 
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 ARMAhmed 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
 
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 ledBenux 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 tokensartisriva
 
Lecture on PIC-1.pptx
Lecture on PIC-1.pptxLecture on PIC-1.pptx
Lecture on PIC-1.pptxgodfrey35
 
Ins and Outs of GPIO Programming
Ins and Outs of GPIO ProgrammingIns and Outs of GPIO Programming
Ins and Outs of GPIO ProgrammingICS
 
plc_training_manual.pdf
plc_training_manual.pdfplc_training_manual.pdf
plc_training_manual.pdfMarioHaguila
 
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éxicoInterlatin
 
Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVRMohamed Abdallah
 
Mitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 seriesMitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 seriesDien Ha The
 
Mitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 seriesMitsubishi inverter freqrol-f700 series
Mitsubishi inverter freqrol-f700 seriesDien Ha The
 
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.vnDien Ha The
 

Ähnlich wie 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
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
 
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
 

Kürzlich hochgeladen

ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Kürzlich hochgeladen (20)

ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

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