当前位置:网站首页>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
边栏推荐
- Mode of interprocess communication
- re正則錶達式
- Win1远程出现“这可能是由于credssp加密oracle修正”解决办法
- JD freefuck Jingdong HaoMao control panel background Command Execution Vulnerability
- Data stream encryption and decryption of C
- Robocode Tutorial 4 - robocode's game physics
- idea中安装YapiUpload 插件将api接口上传到yapi文档上
- Dynamically add default fusing rules to feign client based on sentinel + Nacos
- C language array processing batch data
- Docker 安装 Redis
猜你喜欢

How to install jsonpath package
![[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)](/img/91/3272d5ad04cd1d8476c739546f4356.png)
[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)

Dock installation redis

Docker 安装 MySQL

Install the yapiupload plug-in in idea and upload the API interface to the Yapi document

【ACM】376. Swing sequence
![解决报错max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]](/img/5f/a80951777a0473fcaa685cd6a8e5dd.png)
解决报错max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
Scikit learn sklearn 0.18 official document Chinese version

【ACM】455. 分发饼干(1. 大饼干优先喂给大胃口;2. 遍历两个数组可以只用一个for循环(用下标索引--来遍历另一个数组))

MATLAB从入门到精通(二)
随机推荐
k8s之实现redis一主多从动态扩缩容
Identification verification code
Dynamically add default fusing rules to feign client based on sentinel + Nacos
Rust: shared variable in thread pool
[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)
proxy server
How to read literature
Implementation of k8s redis one master multi slave dynamic capacity expansion
Climbing watermelon video URL
硬核解析Promise对象(这七个必会的常用API和七个关键问题你都了解吗?)
【ACM】509. 斐波那契数(dp五部曲)
powerdesigner各种字体设置;preview字体设置;sql字体设置
Correct opening method of option
Win1远程出现“这可能是由于credssp加密oracle修正”解决办法
Crawling mobile game website game details and comments (MQ + multithreading)
.105Location
Implementation of image recognition code based on VGg convolutional neural network
Robocode Tutorial 4 - robocode's game physics
Test post and login function
Crawler for querying nicknames and avatars based on qqwebapi