In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is the working mode of STM32 single-chip microcomputer iMab O". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. below, please follow the editor's train of thought to study and learn "what is the working mode of STM32 single-chip microcomputer IZhiO"?
Let's talk about GPIO first.
Before talking about these eight working modes, I would like to talk about the concept of GPIO-general input and output General Purpose Input Output referred to as GPIO, that is, chip pins can output high and low levels through them, and they can also input and read the voltage and level status of the pins.
The following eight working modes I will analyze and introduce around the following picture, read this picture, you can basically fully understand the GPIO of STM32. I hope you will take a closer look.
Four different output modes
Push-pull output: in this mode, the pin can output high and low level, and can connect and drive digital devices. For push-pull, some friends may not know what it means, in fact, it is very simple, that is, two NPN, PNP transistors or NMOS and PMOS transistors with the same parameters exist in the circuit in a push-pull way, each responsible for the task of amplifying the positive and negative half-cycle waveforms. Only one of the two symmetrical transistors is turned on at a time, which has low loss and high efficiency, which can not only improve the load capacity of the circuit, but also improve the switching speed. The circuit is shown in the following figure, you can go to the IO internal diagram to compare it.
Open-drain output: in this mode, the pin is connected to the drain of the NMOS in the image above, and the PMOS is turned off and removed. At this time, the pin can only output a low level, not a high level. It needs to add a pull resistance to the pin to get a high level. At this time, there must be little friends wondering, this thing is not as good as push-pull output ah, wrong! Open-drain output has some special advantages, such as: 1, it can be used to connect devices that do not match the main control level, only need to connect the pull-up end of the pull-up resistor to the other level; 2, to make use of the driving ability of the external circuit, reduce the internal current, the internal only needs a very small gate drive current. The disadvantage is that there will be a rising edge delay, because there is a pull-up resistance, which you can read my last article on level matching, which is introduced.
Reuse push-pull output, reuse open-drain output: as the name implies, this mode is to reuse the pin for other functions, is no longer a simple GPIO. For example, the output pin of our commonly used UART, SPI and so on is the multiplexed push-pull output, and our commonly used I2C is the multiplexed open-drain output, so we should know why we need to pull up the resistor when using I2C. Here is a foreshadowing for everyone-why open the leak when using I2C? Friends who know can reply in the message area. I will talk to you in detail when I have the opportunity to analyze I2C later.
Four different input modes
Floating input: this input mode is generally used to detect external high and low level states, such as keys. Combined with the IO internal diagram below, the up-and-down resistors are not connected during floating input, and the pin level state is uncertain, so the data read in this mode is meaningless if the pin is suspended.
Pull-up and drop-down input: basically look at the name, you already know what this mode is all about. In the picture above, if the red ring resistance above is connected to the pull-up input, the lower red ring resistance access is the drop-down input. As I said in the previous paragraph, the floating input mode is used for keystroke input detection. If you use the pull-up and pull-down modes, it will be easier to save the external pull-up resistors and save the project cost.
Analog input: this mode is also very commonly used, that is, the pin is set to the analog signal input of the ADC inside the STM32. It is worth noting that this mode is not available to all IO and can be set up with IO eloquence with ADC.
Add something.
With regard to the two protection diodes inside the IO pin, I saw a long time ago that someone said it was used for clamping. Later, when I attended the ST seminar, I asked the authorities, and the official reply was that it was not used for clamping but for ESD protection. When pins are used as ADC inputs, we must ensure that the input analog signal does not exceed 3.6V ADC 5V is not allowed.
It is said above that there is diode protection inside the chip pin, but I suggest that if you design the pin out of the board, it is best to add TVS diode to strengthen the protection, because the pin is easily hurt by static electricity and other external factors. For example, when I have enough space in the download interface, I will put a SOT-23 TVS diode to protect it.
Thank you for your reading, the above is the content of "what is the working mode of STM32 single-chip microcomputer Ipicuro". After the study of this article, I believe you have a deeper understanding of what the working mode of STM32 single-chip microcomputer Ipicuro has, and the specific use still needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.