STM32 View System Clock

Publisher:莫愁前路Latest update time:2016-07-30 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Call the library function RCC_GetClocksFreq, which returns the frequencies of various clocks on the chip.

Function prototype void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks)

RCC_ClocksTypeDef is defined in the file "stm32f10x_rcc.h":

typedef struct
{
  uint32_t SYSCLK_Frequency; /*!<  SYSCLK clock frequency expressed in Hz */
  uint32_t HCLK_Frequency;   /*!<  HCLK clock frequency expressed in Hz   */
  uint32_t PCLK1_Frequency;  /*!<  PCLK1 clock frequency expressed in Hz  */
  uint32_t PCLK2_Frequency;  /*!<  PCLK2 clock frequency expressed in Hz  */
}RCC_ClocksTypeDef;

Example:
/* Get the frequencies of different on chip clocks */
RCC_ClocksTypeDef RCC_Clocks;  
RCC_GetClocksFreq(&RCC_Clocks);

After execution, directly check RCC_Clocks and take out the required clock frequency from each member.

Keywords:STM32 Reference address:STM32 View System Clock

Previous article:STM32F407 external SRAM
Next article:STM32_ADE7758 driver

Recommended ReadingLatest update time:2024-11-17 00:19

Hardware BUG in STM32 serial port, pay attention!
When debugging the serial port, it was found that the serial port would frequently interrupt, resulting in the inability to execute the main loop! Debugging revealed that it was a hardware bug of the serial port interrupt: 1. USART_ITConfig(USART1, USART_IT_RXNE, ENABLE); The receive interrupt is enabled, and the OR
[Microcontroller]
Hardware BUG in STM32 serial port, pay attention!
STM32 GPIO push-pull output routine
/* GPIO configuration */ void GPIO_config() {     GPIO_InitTypeDef GPIO_InitStructure;       /* Enable GPIOC clock */     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);       /* Set the GPIOC registers to default parameters */     GPIO_DeInit(GPIOC);       /* Set GPIOC to push-pull output */     GPIO_InitStru
[Microcontroller]
STM32 serial port DMA mode sends data
DMA sends data After starting DMA and sending is completed, a DMA sending completion interrupt is generated. The following operations are performed in the DMA interrupt service function:  Place the data to be sent in the data send buffer (the first address of this data buffer must be written into the DMA configur
[Microcontroller]
After STM32 is powered on, GPIO defaults to Floating input
Real case 1: Use the PD13 of the STM32 development board to test, directly exposing the pins. Hardware connection: The longer end of the light-emitting diode in my hand is the + pole, and the development board finds GND to connect the shorter end of the diode, which is the - pole. #define TSBUZGPIO             
[Microcontroller]
After STM32 is powered on, GPIO defaults to Floating input
Summary of STM32 NVIC and interrupts
Preface:  1. To learn STM32 interrupts, you must first understand STM32's definition of priority;  2. Experience in 51 MCU development will make it easier to understand interrupt priorities;  3. This blog post is based on the STM32F103ZET6 chip and 3.5.0 standard library;  4. This blog post starts with registers and e
[Microcontroller]
Summary of STM32 NVIC and interrupts
STM32 serial port double buffer ping-pong data transmission method
For those who have never played with DMA, here is a brief introduction to DMA. Let's say it in your own words. That is, data is transferred from a certain location to a certain location. If DMA is not used, the CPU must be involved in the operation, moving byte by byte, or more efficiently, moving word by word. But wh
[Microcontroller]
STM32 serial port double buffer ping-pong data transmission method
Detailed usage of STM32's IWDG (independent watchdog)
1. Introduction to IWDG:   STM32 has two watchdogs, one is an independent watchdog and the other is a window watchdog. The independent watchdog is known as a pet dog, and the window watchdog is known as a police dog. In this chapter, we mainly analyze the functional block diagram and application of the independent wat
[Microcontroller]
Detailed usage of STM32's IWDG (independent watchdog)
STM32 High Resolution Timer (HRTIM) Usage Example PWM
STM32 high-resolution function is very powerful, the number of registers is very large, and it is also troublesome to use. This article uses HRTIM1 to generate a set of complementary output PWM. The initialization of the high-resolution timer is much more complicated than that of an ordinary timer.  HRTIM_OutputCfgTyp
[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号