当前位置:网站首页>STM32 learning record 0008 - GPIO things 1
STM32 learning record 0008 - GPIO things 1
2022-04-23 18:13:00 【Li Xingye】
One 、GPIO working principle
Prepare information
-
《STM32 Chinese Reference Manual 》 Chapter viii. : Common and reusable functions I/O(GPIO and AFIO)
-
《 Chip data book (datasheet)》 Official website address https://www.stmcu.com.cn/Product/pro_detail/STM32F103/product

-
《STM32 Incomplete manual - Library function version 》
-
《STM32 Incomplete manual - Register version 》
1.1、GPIO Basic structure and working mode
1.1.1 Basic structure description
My board is 64 Pin
Chip data manual page 19 page

STM32F103RCT6
4 Group IO mouth 16*3+2=51 One pin :
- GPIOA0-A15
- GPIOB0-B15
- GPIOC0-C15
- GPIOD0-D2
IO The port can also be connected to peripherals
Chip data manual page 23 page
PA9,PA10 It's also a serial port 1 Pin

GPIO The basic structure :
Chinese reference manual page 105 page


1.1.2 Working mode
4 Input mode :
-
Enter the float

-
Input pull-up

-
Type in the dropdown

-
Analog input

4 Output mode :
- Open drain output
(1) Output 1 when :

(2) Output 0 yes :

-
Open drain multiplexing function
This output 1 Or 0 The situation is basically the same as that of open drain output , The difference is that the output data is obtained by the peripheral

-
Push pull output
(1) Output 1 when :

(2) Output 0 when :

- Pull back multiplexing function
The pullback multiplexing function here is basically the same as that of the previous open drain , The following output methods are the same , But the previous output source is different .

Be careful :
Open drain output : It can output high and low levels , Connect digital devices
Open drain output : Only strong low level can be output , High level needs to be pulled up by external resistance . The output end is opposite to the collector of the triode , To get a high level, you need to pull up the resistor , It's suitable for current drive , Its ability to absorb current is relatively strong ( commonly 20ma within )
3 Maximum turning speed :
- 2MHZ
- 10ZHZ
- 50MHZ
1.2、GPIO Register description
Each group GPIO Port registers include :
Two 32 Bit configuration register (GPIOx_CRL,GPIOx_CRH)
Two 32 Bit data register (GPIOx_IDR,GPIOx_ODR)
One 32 Position position / Reset register (GPIOx_BSRR)
One 16 Bit reset register (GPIOx_BRR)
One 32 Bit lock register (GPIOx_LCKR)
Chinese Reference Manual 113 page

Chinese Reference Manual 114 page

Chinese Reference Manual 115 page



1.3、STM32F10x GPIO Pin description
(1) Port multiplexing function
What is reuse , Simple understanding , It's just that a man's language talent is very good , chinese 、 english 、 Korean 、 He can speak Thai , His boss, Mr. Hui, can only speak Chinese , But the business is very big , Running all over the world . Just hire him as an interpreter . When the boss goes to England on business , He translated English for the boss ; When the boss goes to India on business , He translated Thai for his boss , This function is configured by him , Then he will translate whatever language the boss wants him to translate , and STM32 Of IO What functions does the port have? We can find it in the chip data manual , Then you are its boss , If you want him to realize what function, he can realize what function !
The biggest function of reuse is to maximize the use of IO Oral resources !!! And the boss wants to hire employees who know everything !
Chip data book 30 page

(2) Port remapping function
What is port remapping , President Hui is on a business trip to Sanya , I didn't expect to meet a Malaysian customer , I really want to order the products of Hui head office , But this man speaks Malay , And President Hui didn't take Daxiong on this business trip , But only the Secretary Xiao Lan , So Xiaolan Weihui always said through an idea , President Hui and I are on a Bluetooth phone , Then you communicate with customers , I'll act as your interpreter temporarily , Communicate with customers . In the process , Xiao Lan uses certain technical means to translate Da Xiong's translation function , Give it to yourself temporarily , Is to realize the remapping of translation function , about IO Mouth is the original A9,A10 Serial port 1 function , From new mapping to PB6,PB7 Pin .
Chip data book 33 page

Chip data book 35 page

版权声明
本文为[Li Xingye]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231812105499.html
边栏推荐
- Rewrite four functions such as StrCmp in C language
- [UDS unified diagnostic service] v. diagnostic application example: Flash bootloader
- Matlab tips (6) comparison of seven filtering methods
- 多功能工具箱微信小程序源码
- Random number generation of C #
- re正則錶達式
- [UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)
- Format problems encountered in word typesetting
- Differences between SSD hard disk SATA interface and m.2 interface (detailed summary)
- Installation du docker redis
猜你喜欢

C medium? This form of

Robocode tutorial 5 - enemy class

Gobang game based on pyGame Library

Implementation of k8s redis one master multi slave dynamic capacity expansion

多功能工具箱微信小程序源码

C# 的数据流加密与解密

Docker 安裝 Redis

Qtablewidget usage explanation

GDAL + ogr learning

Transfer learning of five categories of pictures based on VGg
随机推荐
Classes and objects
C#的随机数生成
Qtablewidget usage explanation
C network related operations
Implementation of image recognition code based on VGg convolutional neural network
Scikit learn sklearn 0.18 official document Chinese version
Build openstack platform
Closure type of rust (difference between FN, fnmut and fnone)
ArcGIS table to excel exceeds the upper limit, conversion failed
mysql自动启动设置用Systemctl start mysqld启动
Gobang game based on pyGame Library
MySQL 中的字符串函数
Reptile efficiency improvement method
Re regular expression
Arcpy adds fields and loop assignments to vector data
Box pointer of rust
Install the yapiupload plug-in in idea and upload the API interface to the Yapi document
Batch export ArcGIS attribute table
C# 的数据流加密与解密
Process management command