STM32 clock tree notes

Publisher:机械梦想家Latest update time:2015-11-11 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 STM32 has five clock sources: HSI, HSE, LSI, LSE, PLL
1.1  HSI: high-speed internal clock, RC oscillator, frequency is 8MHz, clock accuracy is poor, can be used as a backup clock source (clock safety system CSS).
1.2  HSE: high-speed external clock, can connect external crystal/ceramic resonator (4MHz~16MHz) or external clock source (HSE bypass, Max 25MHz).
1.3  LSI: low-speed internal clock, RC oscillator, frequency is 40kHz, large-capacity MCU can perform LSI clock calibration.
1.4  LSE: low-speed external clock, connect external crystal/ceramic resonator with a frequency of 32.768kHz.
1.5  PLL: phase-locked loop multiplier output, clock input source can select HSI/2, HSE or HSE/2. The multiplier can be selected from 2 to 16 times, with a maximum output of 72MHz.

Users can configure the frequency of the AHB bus, high-speed APB2 bus and low-speed APB1 bus through multiple prescalers. The maximum frequency of the AHB and APB2 domains is 72MHZ. The maximum allowed frequency of the APB1 domain is 36MHZ. The clock frequency of the SDIO interface is fixed to HCLK/2.
   The 40kHz LSI is used by the independent watchdog IWDG, and it can also be selected as the clock source of the real-time clock RTC. In addition, the clock source of the real-time clock RTC can also select LSE, or 128 division of HSE. The clock source of RTC is selected by RTCSEL[1:0].
   There is a full-speed USB module in STM32, and its serial interface engine requires a clock source with a frequency of 48MHz. This clock source can only be obtained from the PLL output, and can be selected as 1.5 division or 1 division, that is, when the USB module needs to be used, the PLL must be enabled and the clock frequency is configured to 48MHz or 72MHz.
   In addition, STM32 can also select a PLL output divided by 2, HSI, HSE, or system clock output to the MCO pin (PA8)
   The system clock SYSCLK is the clock source for most components in STM32. The system clock can be selected as PLL output, HSI or HSE. Before selecting the clock source, be sure to determine whether the target clock source has stable oscillation. Max=72MHz, it is divided into 2 channels, 1 channel is sent to I2S2CLK and I2S3CLK used by I2S2 and I2S3; the other channel is divided by the AHB divider (1/2/4/8/16/64/128/256/512) and sent to the following 8 modules:
① SDIOCLK clock for SDIO.
② FSMCCLK clock for FSMC.
③ HCLK clock for AHB bus, core, memory and DMA.
④ System timer clock (SysTick) sent to Cortex after being divided by 8.
⑤ Directly sent to the Cortex idle running clock FCLK.
⑥ Sent to the APB1 divider. The APB1 divider can select 1, 2, 4, 8, 16 frequency divisions, one of its outputs is used by the APB1 peripherals (PCLK1, maximum frequency 36MHz), and the other is sent to the timer (Timer2-7) 2, 3, 4 frequency multipliers. The frequency multiplier can select 1 or 2 frequency multiplication, and the clock output is used by timers 2, 3, 4, 5, 6, 7.
⑦ Sent to the APB2 divider. The APB2 divider can select 1, 2, 4, 8, 16 frequency divisions, one of its outputs is used by the APB2 peripherals (PCLK2, maximum frequency 72MHz), and the other is sent to the timer (Timer1, Timer8) 1, 2 frequency multipliers. The frequency multiplier can select 1 or 2 frequency multiplication, and the clock output is used by timer 1 and timer 8. In addition, the APB2 divider has an output for the ADC divider. After the frequency division, the ADCCLK clock is sent to the ADC module. The ADC divider can be selected as 2, 4, 6, or 8 divisions.
⑧ After the frequency division, it is sent to the SDIO AHB interface for use (HCLK/2) 2

Clock  output enable control
Many of the above clock outputs have enable controls, such as the AHB bus clock, core clock, various APB1 peripherals, APB2 peripherals, etc.
   When a module needs to be used, the corresponding clock must be enabled first.
   It should be noted that the timer multiplier, when the APB division is 1, its multiplier value is 1, otherwise its multiplier value is 2.
   The devices connected to APB1 (low-speed peripherals) are: power interface, backup interface, CAN, USB, I2C1, I2C2, UART2, UART3, SPI2, window watchdog, Timer2, Timer3, Timer4. Note that although the USB module requires a separate 48MHz clock signal, it should not be the clock for the USB module to work, but only the clock provided to the serial interface engine (SIE). The clock for the USB module to work should be provided by APB1.
   The devices connected to APB2 (high-speed peripherals) are: GPIO_A-E, USART1, ADC1, ADC2, ADC3, TIM1, TIM8, SPI1, ALL


--------------------------------------------------------------------------------------------------
The following figure is a block diagram of the STM32F10xx clock system. Through this figure, you can see at a glance the path of the clock generation of each component, and you can also easily calculate the clock frequency of each part. The

four clock sources of STM32 (HSI, HSE, LSI and LSE) are also marked in the figure; the clock monitoring system (CSS) in the middle of the figure is a safety setting that appears in many ST7 microcontrollers.

Special attention: On the right side of the figure, there is a multiplier before the output timer clock. Its operation is not controlled by the program, but is automatically selected by the hardware according to the output of the APB pre-divider of the previous level. When the division factor of the APB pre-divider is 1, this multiplier has no effect; when the division factor of the APB pre-divider is greater than 1, this multiplier performs a frequency doubling operation, that is, multiplying the frequency output by the APB pre-divider by 2, which can ensure that the timer can get the highest 72MHz clock pulse.

[Reprint] STM32 Clock Tree Notes

 
Keywords:STM32 Reference address:STM32 clock tree notes

Previous article:Linux-2.6.28 transplantation process based on Feiling 2440 development board
Next article:The relationship between EXTI (external interrupt) and NVIC (nested vector interrupt) in STM32

Recommended ReadingLatest update time:2024-11-16 23:33

Design of remote temperature control system using STM32
Temperature control is one of the main objects of industrial control. The commonly used mathematical model for temperature control is first-order inertia plus a pure lag link, but it varies greatly with different heating objects and environmental conditions. Because the temperature control object has a relativ
[Microcontroller]
Design of remote temperature control system using STM32
Stm32 timer interrupt triggers AD sampling
There is no doubt that the ADC of Stm32 has DMA function, which is also what we use most! However, if we want to sample a signal (such as a pulse signal) at a fixed time (that is, after a period of time, such as 2ms), there are three methods:  1) Use timer interrupt to perform ADC conversion at regular intervals. Th
[Microcontroller]
STM32 study notes-external interrupt
1. Introduction to STM32 external interrupts Each IO of STM32 can be used as an interrupt input port for external interrupts. The interrupt controller of STM32F103 supports 19 external interrupt/event requests. Each interrupt has a status bit, and each interrupt/event has independent trigger and mask settings. The c
[Microcontroller]
STM32 study notes-external interrupt
STM32->RTC
For STM32 time control in a larger range, Delay() function and tim can no longer be used, right?     The RTC (Real Time Clock) real-time clock unit can continue to work through the backup battery even if the system power is turned off. The RTC can transmit 8-bit data (BCD code) to the CPU through the two ARM instruc
[Microcontroller]
STM32->RTC
stm32 interrupt vector controller
NVIC, Chinese name Nested Interrupt Vector Controller, is a unique integrated unit inside the Cortex-M3 series controller, which is closely integrated with the CPU, reduces interrupt latency and can handle subsequent interrupts more efficiently. For example, when buying tickets at a train station, the rules and regula
[Microcontroller]
STM32 clock configuration
1. In STM32, there are five clock sources: HSI, HSE, LSI, LSE, and PLL. ①HSI is a high-speed internal clock, RC oscillator, with a frequency of 8MHz. ②HSE is a high-speed external clock that can be connected to a quartz/ceramic resonator or an external clock source with a frequency range of 4MHz~16MHz. ③LSI is a low-s
[Microcontroller]
keil, stm32 use ulink2 to connect and view variable settings
Open a routine and set the chip model. Set debug options, click setting, and continue setting. For detailed settings, please refer to "ULINK2_User Guide_Chinese_Instructions.pdf". When using Ulink2, sometimes keil prompts "no Jlink found". You can set the default flash downloader in utilities and set the fla
[Microcontroller]
keil, stm32 use ulink2 to connect and view variable settings
Stm32 TFT LCD display control study notes
Learning STM32, TFT LCD display control is a very important chapter. I encountered many difficulties in the initial learning of STM32, so I listed some important knowledge points accumulated in the study. At present, the commonly used TFT LCD internal driver chips are ILI9320 and ILI9325 series. The internal principles
[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号