当前位置:网站首页>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
边栏推荐
- Scikit learn sklearn 0.18 official document Chinese version
- 【ACM】509. Fibonacci number (DP Trilogy)
- .105Location
- re正則錶達式
- Using files to save data (C language)
- MySQL auto start settings start with systemctl start mysqld
- C [file operation] read TXT text by line
- Crawler for querying nicknames and avatars based on qqwebapi
- journal
- Map basemap Library
猜你喜欢
JD-FreeFuck 京東薅羊毛控制面板 後臺命令執行漏洞
Docker 安裝 Redis
GDAL + ogr learning
Robocode tutorial 5 - enemy class
JD-FreeFuck 京东薅羊毛控制面板 后台命令执行漏洞
Install pyshp Library
Closure type of rust (difference between FN, fnmut and fnone)
Re expression régulière
Robocode tutorial 8 - advanced robot
Calculation of fishing net road density
随机推荐
Rewrite four functions such as StrCmp in C language
Docker 安装 MySQL
Rust: how to implement a thread pool?
Queue solving Joseph problem
GDAL + ogr learning
多功能工具箱微信小程序源码
How to read literature
C language array processing batch data
C language to achieve 2048 small game direction merging logic
I / O multiplexing and its related details
Install pyshp Library
[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)
Differences between SSD hard disk SATA interface and m.2 interface (detailed summary)
Feign requests the log to be printed uniformly
Process management command
解决允许在postman中写入注释请求接口方法
Implementation of object detection case based on SSD
Gson fastjason Jackson of object to JSON difference modifies the field name
MySQL 中的字符串函数
JD-FreeFuck 京东薅羊毛控制面板 后台命令执行漏洞