Why does STM32 have to configure the clock first and then the GPIO?

Publisher:古通闲人Latest update time:2016-06-23 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
All registers require a clock to be configured. The registers are composed of D flip-flops. Only when the clock is sent can the flip-flops be rewritten.

 

Any peripheral of any MCU needs a clock, and the same is true for 8051. In order to allow users to better understand power consumption, STM32 sets a switch for the clock of each peripheral, allowing users to precisely control and shut down unnecessary devices to save power.

 

The 51 MCU does not need to configure the IO clock, just because the same clock is used by default, which is convenient, but the power consumption cannot be reduced.
For example, a certain function is not needed, but it is still running.
STM32 needs to configure the clock, so that the power consumption of those functions that are not needed can be removed.

 

When you want to turn off an IO, just turn off the corresponding clock enable. However, in 51, the IO clock is not set when using IO. In STM32, there are external and internal clocks. Study the clock carefully.

 

ARM chips are all like this. Peripherals usually need to be clocked before their registers can be set (i.e., the peripherals can be used). STM32, LPC1XXX, etc. are all like this.
The purpose of doing this is to save power, using the so-called clock gating technology.
This also belongs to the category of synchronous circuits in circuits: synchronous circuits always require 1 clock.

Keywords:STM32 Reference address:Why does STM32 have to configure the clock first and then the GPIO?

Previous article:About STM32 header files
Next article:STM32 series microcontroller development tools and applications - keil

Recommended ReadingLatest update time:2024-11-16 13:21

STM32 timer as external pulse signal counter
Today, I tried to use the external clock function of the STM32 counter to count the external pulse signal. The effect is quite good. The specific settings are as follows: /* TIM3_CH2 is the pulse input port 1. Configure GPIO_GPIOA_PIN7 input 2. Configure TIM3 counter to count the rising edge at TI2:     1).
[Microcontroller]
stm32 BKP register operation operation register + library function
BKP is the abbreviation of "BACKUP". The stm32f103RCTE is equipped with 10 16-bit BKP registers. When the main power is cut off or the system generates a reset time, the BKP register can still maintain its content with the support of the backup power supply.  In practical applications, BKP can store important data to
[Microcontroller]
stm32 BKP register operation operation register + library function
STM32 Timer PWM_Output
The pulse width modulation mode can generate a signal with a frequency determined by the TIMx_ARR register and a duty cycle determined by the TIMx_CCRx register. The following is an example of PWM mode 1. The PWM signal reference OCxREF is high when TIMx_CNT   Library function STM32F10x_StdPeriph_Lib_V3.3.0\Proje
[Microcontroller]
STM32 Timer PWM_Output
STM32 I2C deadlock issue
background In fact, this article has written about the solution a long time ago. After continuous practice and in-depth research, I found that the problem of hardware I2C deadlock has long been solved in the errata in the official manual of ST. However, I did not pay attention to the official documents and kept seekin
[Microcontroller]
STM32 I2C deadlock issue
Summary of the process of reading and writing EEPROM using I2C in STM32
Configure I/O ports, configure mode, enable GPIO and clock Write: Check if SDA is idle. Checks whether the event was successful. Send a start signal according to the protocol Checks whether the event was successful. Issues the 7-bit device address and write mode. Checks whether the event was successful. The first ad
[Microcontroller]
STM32 introductory study notes: capacitive touch experiment (Part 1)
8.1 Introduction to capacitive touch 8.1.1 Overview of capacitive touch With the development of science and technology, traditional mechanical buttons are gradually disappearing from devices. The main reason for this is that mechanical buttons use mechanical contact and have a relatively short lifespan. From the user
[Microcontroller]
STM32 introductory study notes: capacitive touch experiment (Part 1)
Driver code for TM1629 based on STM32
One year, I wrote a Panyu Longmei game console IO board using STM32F103VBT6 and TM1629. I wrote a driver. I hope it can help friends in need. Without further ado, the code is as follows: #ifdef GAME #include "stm32f10x.h" #include "stdio.h" //TM1629 chip select //STB #define TM1629_STB GPIOC #define TM1629_CSA GPIOC,
[Microcontroller]
Naming principles of Stm32 and STC
I went to STC's official website and felt that it was really a copycat. It's really not easy to find that even the data sheet is so copycat. But it's good to use, I feel the function is quite powerful. Support domestic products.     STM32 series naming convention STM32 F 103 C 6 T 7 xxx 1      2    3    4
[Microcontroller]
Naming principles of Stm32 and STC
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号