4 output modes of STM32 pins

Publisher:温馨幸福Latest update time:2018-06-18 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Normal push-pull output (GPIO_Mode_Out_PP):

 

Application: Generally used in 0V and 3.3V applications. The circuit passes through two P_MOS and N_MOS tubes, which are responsible for pulling up and pulling down current.

 

Usage: Direct use

 

Output level: The low level of push-pull output is 0V and the high level is 3.3V.

 

2. Normal open-drain output (GPIO_Mode_Out_OD):

 

Application occasions: Generally used in situations where the levels do not match, such as when a high level of 5V needs to be output.

 

How to use: You need to connect an external pull-up resistor, the power supply is 5V, set the GPIO to open-drain mode, and when the output is high, the pull-up resistor and the power supply output a 5V voltage.

 

Output level: In open-drain output mode, if the output is 0, low level, the N_MOS is turned on and the output is grounded. If the control output is 1 (cannot directly output high level), neither high level nor low level is output, which is a high configuration. For normal use, a pull-up resistor must be connected externally.

 

Features: It has a "wired-and" feature, that is, when many open-drain mode pins are connected together, the pull-up resistor provides a high level only when all pins output a high impedance state. The voltage of this high level is the voltage of the power supply connected to the external pull-up resistor. If one of the pins is at a low level, the line is equivalent to a short circuit to ground, making the entire line at a low level, 0 volts.

 

3. Multiplexed push-pull output (GPIO_Mode_AF_PP): used as serial port output.

 

4. Multiplexed open-drain output (GPIO_Mode_AF_OD): used in IIC.


Keywords:STM32 Reference address:4 output modes of STM32 pins

Previous article:Problems with STM32 tick clock source
Next article:STM32 burning file .bat analysis

Recommended ReadingLatest update time:2024-11-16 22:25

The principle, use and configuration of PWM peripherals in STM32
As for what PWM is, just search on Baidu. In fact, the content is simple. First of all, the PWM function in STM32 is implemented using a counter, which is similar to 51, but there are also differences. 51 uses the interrupt of the counter to adjust the duty cycle, which takes up the time of the MCU. However, STM32 use
[Microcontroller]
How to set the frequency and duty cycle of PWM in STM32? See here
The following is the timer logic diagram of STM32 , which helps to understand: TIM3's ARR register and PSC register, Determine the PWM frequency. The two timers configured here determine the frequency of PWM. My understanding is that the period (frequency) of PWM is the multiplication of the ARR register va
[Microcontroller]
How to set the frequency and duty cycle of PWM in STM32? See here
STM32 key input, required C language review, clock system block diagram
first part: STM32 key input is my second small example of input on the STM32 platform. The idea is to first query the hardware diagram to see whether the key is low-level effective or high-level effective. According to my development environment, I know that three of the four keys are low-level effective and one is hi
[Microcontroller]
Read protection for STM8S/32
1. Steps for code writing and read protection: 1. Preparation: After the HEX file and JLINK driver (JLinkARM_V420 or above, secure chip may appear gray and unselectable in 4.08) are installed, you can open the application in Start--All Programs--SEGGER--J-Flash ARM First set the chip to be written and the writing me
[Microcontroller]
Experts show you how to analyze STM32 BSRR BRR ODR registers
 1. Usage You will often see macro definition statements similar to the following, which are used to output high or low levels to the initialized IO ports. #define SET_BL_HIGH() GPIOA- BSRR=GPIO_Pin_0 #define SET_BL_LOW() GPIOA- BRR=GPIO_Pin_012 Its function is similar to the following two library functions: v
[Microcontroller]
STM32 delay function encapsulation program
    /*---------------------------------     Delay module function     Note: Just add delay.c and delay.h to the project     file, you can use Delayms(__IO uint32_t nTime);     Delay(__IO uint32_t nTime)     -----------------------------------*/     #ifndef __DELAY_H     #define __DELAY_H     #include "stm32f10x.h"  
[Microcontroller]
How to deal with stm32 crash
Crash process basic concept: Link register LR: When calling a subroutine, it automatically stores the address to be returned next time, which is actually the address of the function that was most recently called. Crash process: What we need to pay most attention to here is the first step of stacking: The
[Microcontroller]
How to deal with stm32 crash
Design of intelligent motor protector based on STM32
0 Introduction Motors are the main driving source in the field of industrial production. How to effectively monitor the operating status of motors, protect motor circuits, increase motor operating time, and reduce motor failures is critical to the operation of the factory's overall power grid. There ar
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号