Overview of STM32 GPIO registers

Publisher:LovingLife2023Latest update time:2018-08-26 Source: eefocusKeywords:STM32  GPIO  register Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

A GPIO register is generally divided into three categories: a. control register; b. data register; c. latch register

A. Control register (GPIO_CRL or GPIO_CRH (CRL corresponds to the lower 8 bits, CRH corresponds to the upper 8 bits)). See page 106 of the manual for details.

CNFx[1:0]MODE[1:0]

XX00-----Input mode (generally not talking about speed)

XX01-----Output mode (10M rate)

XX10----Output mode (2M rate)

XX11----Output mode (50M rate)

In output mode (50M as an example)

0011----Universal push-pull output

0111----General open drain output

1011----Multiplexed push-pull output

1111----Multiplexed open drain output

In input mode

0000---Analog input (for ADC)

0100---Floating input

1000 --- Pull-up/pull-down input (when the corresponding ODR output is 1, it is pull-up, and when the output is 0, it is pull-down)

The specific applications are as follows:

B. Data registers 1) Input data register IDR; 2) Output data register ODR; 3) Bit set/clear register BSSR; 4) Bit clear register BRR

BSSR can realize the synchronous change of two bits; it can also realize "read, modify and write"

C. Latch register

 

 

This still has some problems????????????

The first two categories must be mastered. Every register of each peripheral must be read once and must be gone through.


Keywords:STM32  GPIO  register Reference address:Overview of STM32 GPIO registers

Previous article:Understanding of GPIO of stm32
Next article:STM32 USART register programming

Recommended ReadingLatest update time:2024-11-16 11:27

Design of multiple functional modules of universal testing machine based on STM32 and STM8 processors
    Based on STM32 and STM8 processors, multiple functional modules of the universal testing machine were designed. In order to improve the acquisition accuracy and speed of small signals, a hybrid phase-locked amplifier was designed using multiple processors, and digital processing was used for further processing, wh
[Microcontroller]
stm32 basic experiment 1
1. GPIO Basics 4 input modes:  Floating, pull-up, pull-down, analog input  4 output modes:  Open-drain output  Open-drain multiplexing function  Push-pull output  Push-pull multiplexing function  3 maximum output speeds: 2MHZ, 10MHz, 50MHz      in  Push-pull output: can output strong high and low levels, con
[Microcontroller]
stm32 basic experiment 1
STM32 Learning 008_Analysis of ARM Products
ARM is a microprocessor based on RSIC designed by Acorn Ltd. of the UK. Its full name is Acorn RISC Machine. The ARM processor itself is a 32-bit design, but it is also equipped with a 16-bit instruction set. Generally speaking, it saves up to 35% compared to the equivalent 32-bit code, but it can retain all the advan
[Microcontroller]
STM32 Learning 008_Analysis of ARM Products
Detailed explanation of IIC application of STM32 2
IIC Brief Introduction The editor’s ability is limited, so I hope you guys can point out any mistakes I made!       IIC communication usually refers to the IIC simulated by two I/O ports of the microcontroller. The real IIC is actually a hardware circuit, which is the patent of Philips. If you want to use it, you
[Microcontroller]
STM32 study notes - external interrupt EXTI
Study Notes for      STM32F103C8 redesigned  by  zhang  bin 2012-10-30 versions:V-0.1 All  Rights  Reserved   main.c is as follows, with detailed comments. You can basically use it after understanding the following examples and instructions:           //A high preemption level will interrupt
[Microcontroller]
STM32 system clock modification
    Today, the company gave me a new STM32 control board to debug. I thought it would be easy to debug. But I was shocked to find that the crystal oscillator was 12MHZ. I found some information online and now I have sorted it out for your reference.     Specific steps are as follows:    The first step is to search HS
[Microcontroller]
STM32 learning notes timer input capture experiment
Purpose: Print the time the key is pressed on the serial debugging assistant Experimental steps: Experimental Procedure: /******************************timer.c****************** *******************/   #include "sys.h"   #include "stm32f4xx.h"         extern u8 TIM5CHA1_CAPTURE_STA;   extern u16 TIM5CHA
[Microcontroller]
Several ways to implement printf printing log in stm32
When fixing some bugs in the STM32 microcontroller, debugging alone is not enough. Sometimes you need to print logs to view the changing trends of certain variables over a period of time. However, the board is not connected to the serial port, so there is no way to redirect the serial port to print. After searching on
[Microcontroller]
Several ways to implement printf printing log in stm32
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号