当前位置:网站首页>Introduction to STM32 IO port mode
Introduction to STM32 IO port mode
2022-07-18 05:15:00 【Summer night breeze_】
List of articles
GPIO_Mode_AIN: Analog input mode
GPIO_Mode_IN_FLOATING: Floating input mode
GPIO_Mode_IPD: Drop down input mode
GPIO_Mode_IPU: Pull up input mode
GPIO_Mode_Out_OD: Universal open drain output mode
GPIO_Mode_Out_PP: Universal push-pull output mode
GPIO_Mode_AF_OD: Multiplex open drain output mode
GPIO_Mode_AF_PP: Multiplexed push-pull output mode
The first four are input modes , The last four are output modes .
1. Input and output
from 51 The people who came here , Unfamiliar with input and output .51 SCM does not need to set input and output modes , Automatic change , No program configuration required , When we write a program to read the level of the pin , In fact, it is used as an input mode , When we write a program to let the pin output level , In fact, it is used as an output mode . in other words , Not at all 51 SCM has no concept of input and output , But you have used it for a long time but haven't found it .
STM32 And 51 The difference is that : When we want to read the pin level , That is, as input , We must first set the pin to the input function , Before you can read it . When we want to control the high and low levels of pins , That is, as output , We must first set the pin to the output function , You can set .
2. Pull up and pull down
The concept is more abstract , You just need to remember : When there is no external interference on the pin , Pull up is to set the pin to high level , You use a multimeter to measure the pull-up pin , It's high level ; Pull down is to set the pin to low level , You use a multimeter to measure the pull-down pin , It's low level , That is to say 0V.
3. Push pull and open drain
The concept is more abstract , You just need to remember : Set to push-pull , It improves the output current capability of the pin . Set to open drain , That is, the input current capability of the pin is improved . Then you have to know , When set to open leakage , If there is no external pull resistance , The default output is low .
4. General and reuse
General purpose is used as ordinary input and output pins . Multiplexing means that this pin can be used as SPI Pin I2C Pins and other functional pins .
5. Introduction
Combined with the above , You can get some simple application settings .
For example, check the key , It should be set as input , If there is no external pull resistance , You need to set the pin as the pull-up input , In this way, if it is detected that the pin is low , Just press the button . If an external pull-up resistor is added , At this time, you can set the pin as the pull-up input , It can also be set as floating input , Set to these two , Due to external pull-up resistance , The default is high , Again , Low level detected , Just press the button .
When you want to control the high and low levels of pins for application , It is necessary to set the pin as the output function . For example, drive a device , Drive a light-emitting diode, etc . If you want to use high-level light-emitting diode , You need to set the pin to push-pull output , To increase the current output capacity , If you set open drain output , The LED must not be on . But if you use low-level light-emitting diode , Then set to open drain and push-pull output can normally light up the LED .
边栏推荐
- E-commerce platform background management system --- > system detailed design (user management module)
- 点灯
- 分布式事务集成netcore.Cap
- (pc+wap) Zhimeng template waterproof building materials website
- @tap是什么
- hbuilder提交代码
- Information system project manager 10 days before the exam limit sprint + answer (10): summary of comprehensive knowledge
- 牛客2021暑期训练4-J-Average
- Dynamic programming | longest common subsequence
- Xiaobai challenges the first day of learning C language - the construction of the operating environment
猜你喜欢

H5云图后台读写CAD文件-在线CAD,网页CAD,网页浏览编辑CAD

Matlab_ Figure is displayed on the top during debugging

创建线程的方式

Information system project managers must recite the core examination sites (10) information system planning

12306抢票工具震撼来袭

Redis03:Redis的5大常用数据类型

uni-app 标签跳转

STM32F103 串口 +DMA中断实现数据收发

Information system project manager 10 days before the exam limit sprint + answer (6): project procurement management and contract management

牛客2021暑期训练6-H-Hopping Rabbit
随机推荐
动态规划 | 0-1背包问题
Niuke 2021 summer training 5-b-boxes
uni-app 标签跳转
牛客2021暑期训练3-E-Math
牛客2021暑期训练4-E-Tree Xor
牛客2021暑期训练6-H-Hopping Rabbit
信息系统项目管理师核心考点(十一)物联网两项关键技术和架构
现在ChaosBlade对数据库支持哪些故障的模拟呀?老师们有什么资料吗?
Connecting with enterprise wechat, customer relationship management can also be very simple!
Realize the side-by-side display of two elements (including the explanation of some flex attributes)
Niuke 2021 summer training 4-j-average
关于解决token过期失效问题
信息系统项目管理师核心考点(九)组织结构类型
MATLAB初次学习
IAP Bootload 和 App 间跳转的代码实现
Chess all in one
牛客2021暑期训练5-D-Double Strings
微信小程序从入门到学会第九天———-小程序的系统操作
电商平台后台管理系统--->系统详细设计(用户管理模块)
C leetcode brush notes 1- maximum number of words in sentences