当前位置:网站首页>0 basic self-study STM32 (wildfire) -- use register to light LED -- Explanation of GPIO function block diagram
0 basic self-study STM32 (wildfire) -- use register to light LED -- Explanation of GPIO function block diagram
2022-06-29 17:20:00 【Fecter11】

What I use is wildfire stm32zet6( Overbearing development board ) in total 144 One pin , and stm32vet6( Guider development board ) yes 100 One pin .
Be careful GPIO Not a pin , The pin contains GPIO.
Pins such as VCC,GND,CLK wait 
So how to view the function of the pins ?
Find the official data book 
pin definition Is the definition of pin
high density high-density 

For example, the above two commonly used serial ports



Look from right to left
The first is the protective diode , Take the diode on the upper side as an example , If the input voltage is higher than vdd Diode on , take IO The voltage is clamped at 3.3V+ Range of clamping voltage , This protects the input .
For example :
If we want to connect a motor , The starting of the motor generates back electromotive force , The diode has not acted for a short time , So as to damage IO.
In addition, the current when starting is also very large .
So we should pay attention to when connecting the motor . Be sure to connect a drive circuit to isolate .
Push pull output :
What we do is 

Every time 4 One bit controls one GPIO
How to output it specifically 0 or 1 Of ??
Output control register by operation (ODR) To control MOS Output 3.3v or 0v.


It is recommended to understand MOS tube N Tube and P The conduction condition of the tube .
The following figure shows the current flow of output high level , External output , Equivalent to pushing . This is also known as the current infusion , Inject current into the load .
The following figure shows the current flow of output low level , Equivalent to pulling . This is also called pull current .
MOS The internal resistance of the tube is very small , Push pull current can reach 25ma, It's bigger .
The following describes the open drain output
Open drain output can only output low level 

What is the meaning of open drain output ?
For example, we pass through IO There's another one out there 5v The peripherals of , We just need an external pull-up VDD Change it to 5V Level matching can be achieved .
Explain , Most of the above uses MOS tube
Complementary signals , Namely 1/0

The output data register corresponds to ODR
We can directly operate the output data register to achieve output 1/0
It can also be set for indirectly / Clear the write operation of the register to control the data output register to output 1/0
bit set / reset register This is it. BSRR
low 16 Position as set Set up 1
high 16 Position as rest clear 0
That is to say, if we are right BS0 and BR0 All written 1, The actual output is in BS0 Shall prevail or 1
There is also a register that can be implemented ODR Output reset operation 



Input data register Input data register 


This pull-up and pull-down is done by BSRR Register controlled ( In this part of the video, I didn't fully understand the specific implementation methods , Wait until later )
our IO When the input 3.3v All we can read from the register is 1/0. And Schmidt trigger , It's like a door ( I think it's just “ The threshold ”), higher than 2v Think it's high level , Output 1, lower than 1.2v It outputs 0
Input multiplexing function 
Here we add analog output 

边栏推荐
猜你喜欢

Redis 原理 - Sorted Set (ZSet)

ICML 2022 | transferable imitation learning method based on decoupling gradient optimization

如何创建虚拟形象

序列检测器
![[R language data science]: Text Mining (taking Trump's tweet data as an example)](/img/4f/09b9885915bee50fb40976a5002730.png)
[R language data science]: Text Mining (taking Trump's tweet data as an example)

微信小程序开发储备知识
Master slave replication of MySQL

linux中mysql 1045错误如何解决

Tencent cloud released orbit, an automated delivery and operation and maintenance product, to promote enterprise applications to be fully cloud native

curl: (56) Recv failure: Connection reset by peer
随机推荐
Why is informatization ≠ digitalization? Finally someone made it clear
卷妹带你学jdbc—2天冲刺Day1
NVIDIA安装最新显卡驱动
flink sql rownumber 报错。谁遇到过啊?怎么解决?
底层内功修养
KUKA子程序/函数怎么建立和使用方法
Multi mode concurrent implementation of tortoise and rabbit race in go language
About Kali using xshell connection
ICML 2022 | transferable imitation learning method based on decoupling gradient optimization
广发易淘金和东方财富哪个更好,更安全一些
【R语言数据科学】:文本挖掘(以特朗普推文数据为例)
知道创宇为能源行业资产管理助力,入选工信部2021物联网示范项目
深圳内推 | 深圳计算科学研究院招聘机器学习助理工程师(校招)
How to use openmesh to realize the conversion between 3D files of different formats
使用kalibr標定工具進行單目相機和雙目相機的標定
Calibration of binocular camera based on OpenCV
controller、service、dao之间的关系
First batch! Tencent cloud's ability to pass the solution of the government affairs collaboration platform of the China Academy of ICT
regular expression
Online text digit recognition list summation tool