MCU的时钟体系

stm32F4的时钟体系图

1MHZ = 10^6 HZ

  1. 系统时钟频率是168MHZ;
  2. AHB1、AHB2、AHB3总线上的时钟频率是168MHz;
  3. APB1总线上的时钟频率为42MHz;
  4. APB2总线上的时钟频率为84MHz;

stm32F4的时钟体系图

在system_stm32f4xx.c文件中查看APB1和APB2的预分频值到底是多少;

/********************************************************************************* @file    system_stm32f4xx.c* @author  MCD Application Team* @version V1.8.1* @date    27-January-2022* @brief   CMSIS Cortex-M4 Device Peripheral Access Layer System Source File.*          This file contains the system clock configuration for STM32F4xx devices.*             * 1.  This file provides two functions and one global variable to be called from *     user application:*      - SystemInit(): Setups the system clock (System clock source, PLL Multiplier*                      and Divider factors, AHB/APBx prescalers and Flash settings),*                      depending on the configuration made in the clock xls tool. *                      This function is called at startup just after reset and *                      before branch to main program. This call is made inside*                      the "startup_stm32f4xx.s" file.**      - SystemCoreClock variable: Contains the core clock (HCLK), it can be used*                                  by the user application to setup the SysTick *                                  timer or configure other parameters.*                                     *      - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must*                                 be called whenever the core clock is changed*                                 during program execution.** 2. After each device reset the HSI (16 MHz) is used as system clock source.*    Then SystemInit() function is called, in "startup_stm32f4xx.s" file, to*    configure the system clock before to branch to main program.** 3. If the system clock source selected by user fails to startup, the SystemInit()*    function will do nothing and HSI still used as system clock source. User can *    add some code to deal with this issue inside the SetSysClock() function.** 4. The default value of HSE crystal is set to 25MHz, refer to "HSE_VALUE" define*    in "stm32f4xx.h" file. When HSE is used as system clock source, directly or*    through PLL, and you are using different crystal you have to adapt the HSE*    value to your own configuration.** 5. This file configures the system clock as follows:*=============================================================================*=============================================================================*                    Supported STM32F40xxx/41xxx devices*-----------------------------------------------------------------------------*        System Clock source                    | PLL (HSE)*-----------------------------------------------------------------------------*        SYSCLK(Hz)                             | 168000000*-----------------------------------------------------------------------------*        HCLK(Hz)                               | 168000000*-----------------------------------------------------------------------------*        AHB Prescaler                          | 1*-----------------------------------------------------------------------------*        APB1 Prescaler                         | 4*-----------------------------------------------------------------------------*        APB2 Prescaler                         | 2*-----------------------------------------------------------------------------*        HSE Frequency(Hz)                      | 25000000*-----------------------------------------------------------------------------*        PLL_M                                  | 25*-----------------------------------------------------------------------------*        PLL_N                                  | 336*-----------------------------------------------------------------------------*        PLL_P                                  | 2*-----------------------------------------------------------------------------*        PLL_Q                                  | 7*-----------------------------------------------------------------------------*        PLLI2S_N                               | NA*-----------------------------------------------------------------------------*        PLLI2S_R                               | NA*-----------------------------------------------------------------------------*        I2S input clock                        | NA*-----------------------------------------------------------------------------*        VDD(V)                                 | 3.3*-----------------------------------------------------------------------------*        Main regulator output voltage          | Scale1 mode*-----------------------------------------------------------------------------*        Flash Latency(WS)                      | 5*-----------------------------------------------------------------------------*        Prefetch Buffer                        | ON*-----------------------------------------------------------------------------*        Instruction cache                      | ON*-----------------------------------------------------------------------------*        Data cache                             | ON*-----------------------------------------------------------------------------*        Require 48MHz for USB OTG FS,          | Disabled*        SDIO and RNG clock                     |*-----------------------------------------------------------------------------*=============================================================================*=============================================================================*                    Supported STM32F42xxx/43xxx devices*-----------------------------------------------------------------------------*        System Clock source                    | PLL (HSE)*-----------------------------------------------------------------------------*        SYSCLK(Hz)                             | 180000000*-----------------------------------------------------------------------------*        HCLK(Hz)                               | 180000000*-----------------------------------------------------------------------------*        AHB Prescaler                          | 1*-----------------------------------------------------------------------------*        APB1 Prescaler                         | 4*-----------------------------------------------------------------------------*        APB2 Prescaler                         | 2*-----------------------------------------------------------------------------*        HSE Frequency(Hz)                      | 25000000*-----------------------------------------------------------------------------*        PLL_M                                  | 25*-----------------------------------------------------------------------------*        PLL_N                                  | 360*-----------------------------------------------------------------------------*        PLL_P                                  | 2*-----------------------------------------------------------------------------*        PLL_Q                                  | 7*-----------------------------------------------------------------------------*        PLLI2S_N                               | NA*-----------------------------------------------------------------------------*        PLLI2S_R                               | NA*-----------------------------------------------------------------------------*        I2S input clock                        | NA*-----------------------------------------------------------------------------*        VDD(V)                                 | 3.3*-----------------------------------------------------------------------------*        Main regulator output voltage          | Scale1 mode*-----------------------------------------------------------------------------*        Flash Latency(WS)                      | 5*-----------------------------------------------------------------------------*        Prefetch Buffer                        | ON*-----------------------------------------------------------------------------*        Instruction cache                      | ON*-----------------------------------------------------------------------------*        Data cache                             | ON*-----------------------------------------------------------------------------*        Require 48MHz for USB OTG FS,          | Disabled*        SDIO and RNG clock                     |*-----------------------------------------------------------------------------*=============================================================================*=============================================================================*                         Supported STM32F401xx devices*-----------------------------------------------------------------------------*        System Clock source                    | PLL (HSE)*-----------------------------------------------------------------------------*        SYSCLK(Hz)                             | 84000000*-----------------------------------------------------------------------------*        HCLK(Hz)                               | 84000000*-----------------------------------------------------------------------------*        AHB Prescaler                          | 1*-----------------------------------------------------------------------------*        APB1 Prescaler                         | 2*-----------------------------------------------------------------------------*        APB2 Prescaler                         | 1*-----------------------------------------------------------------------------*        HSE Frequency(Hz)                      | 25000000*-----------------------------------------------------------------------------*        PLL_M                                  | 25*-----------------------------------------------------------------------------*        PLL_N                                  | 336*-----------------------------------------------------------------------------*        PLL_P                                  | 4*-----------------------------------------------------------------------------*        PLL_Q                                  | 7*-----------------------------------------------------------------------------*        PLLI2S_N                               | NA*-----------------------------------------------------------------------------*        PLLI2S_R                               | NA*-----------------------------------------------------------------------------*        I2S input clock                        | NA*-----------------------------------------------------------------------------*        VDD(V)                                 | 3.3*-----------------------------------------------------------------------------*        Main regulator output voltage          | Scale1 mode*-----------------------------------------------------------------------------*        Flash Latency(WS)                      | 2*-----------------------------------------------------------------------------*        Prefetch Buffer                        | ON*-----------------------------------------------------------------------------*        Instruction cache                      | ON*-----------------------------------------------------------------------------*        Data cache                             | ON*-----------------------------------------------------------------------------*        Require 48MHz for USB OTG FS,          | Disabled*        SDIO and RNG clock                     |*-----------------------------------------------------------------------------*=============================================================================*=============================================================================*                Supported STM32F411xx/STM32F410xx devices*-----------------------------------------------------------------------------*        System Clock source                    | PLL (HSI)*-----------------------------------------------------------------------------*        SYSCLK(Hz)                             | 100000000*-----------------------------------------------------------------------------*        HCLK(Hz)                               | 100000000*-----------------------------------------------------------------------------*        AHB Prescaler                          | 1*-----------------------------------------------------------------------------*        APB1 Prescaler                         | 2*-----------------------------------------------------------------------------*        APB2 Prescaler                         | 1*-----------------------------------------------------------------------------*        HSI Frequency(Hz)                      | 16000000*-----------------------------------------------------------------------------*        PLL_M                                  | 16*-----------------------------------------------------------------------------*        PLL_N                                  | 400*-----------------------------------------------------------------------------*        PLL_P                                  | 4*-----------------------------------------------------------------------------*        PLL_Q                                  | 7*-----------------------------------------------------------------------------*        PLLI2S_N                               | NA*-----------------------------------------------------------------------------*        PLLI2S_R                               | NA*-----------------------------------------------------------------------------*        I2S input clock                        | NA*-----------------------------------------------------------------------------*        VDD(V)                                 | 3.3*-----------------------------------------------------------------------------*        Main regulator output voltage          | Scale1 mode*-----------------------------------------------------------------------------*        Flash Latency(WS)                      | 3*-----------------------------------------------------------------------------*        Prefetch Buffer                        | ON*-----------------------------------------------------------------------------*        Instruction cache                      | ON*-----------------------------------------------------------------------------*        Data cache                             | ON*-----------------------------------------------------------------------------*        Require 48MHz for USB OTG FS,          | Disabled*        SDIO and RNG clock                     |*-----------------------------------------------------------------------------*=============================================================================*=============================================================================*                         Supported STM32F446xx devices*-----------------------------------------------------------------------------*        System Clock source                    | PLL (HSE)*-----------------------------------------------------------------------------*        SYSCLK(Hz)                             | 180000000*-----------------------------------------------------------------------------*        HCLK(Hz)                               | 180000000*-----------------------------------------------------------------------------*        AHB Prescaler                          | 1*-----------------------------------------------------------------------------*        APB1 Prescaler                         | 4*-----------------------------------------------------------------------------*        APB2 Prescaler                         | 2*-----------------------------------------------------------------------------*        HSE Frequency(Hz)                      | 8000000*-----------------------------------------------------------------------------*        PLL_M                                  | 8*-----------------------------------------------------------------------------*        PLL_N                                  | 360*-----------------------------------------------------------------------------*        PLL_P                                  | 2*-----------------------------------------------------------------------------*        PLL_Q                                  | 7*-----------------------------------------------------------------------------*        PLL_R                                  | NA*-----------------------------------------------------------------------------*        PLLI2S_M                               | NA*-----------------------------------------------------------------------------*        PLLI2S_N                               | NA*-----------------------------------------------------------------------------*        PLLI2S_P                               | NA*-----------------------------------------------------------------------------*        PLLI2S_Q                               | NA*-----------------------------------------------------------------------------*        PLLI2S_R                               | NA*-----------------------------------------------------------------------------*        I2S input clock                        | NA*-----------------------------------------------------------------------------*        VDD(V)                                 | 3.3*-----------------------------------------------------------------------------*        Main regulator output voltage          | Scale1 mode*-----------------------------------------------------------------------------*        Flash Latency(WS)                      | 5*-----------------------------------------------------------------------------*        Prefetch Buffer                        | ON*-----------------------------------------------------------------------------*        Instruction cache                      | ON*-----------------------------------------------------------------------------*        Data cache                             | ON*-----------------------------------------------------------------------------*        Require 48MHz for USB OTG FS,          | Disabled*        SDIO and RNG clock                     |*-----------------------------------------------------------------------------*=============================================================================******************************************************************************* @attention** Copyright (c) 2016 STMicroelectronics.* All rights reserved.** This software is licensed under terms that can be found in the LICENSE file* in the root directory of this software component.* If no LICENSE file comes with this software, it is provided AS-IS.********************************************************************************/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/473367.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

走进嵌入式开发世界

目录 一、概述 二、嵌入式开发的核心要素 2.1. 硬件平台选择与设计 2.1.1. 处理器选择 2.1.2. 电路设计 2.1.3.硬件集成与测试 2.2. 软件开发与调试 2.2.1. 编程语言选择 2.2.2. 操作系统与中间件 2.2.3. 软件架构与模块化设计 2.2.4. 调试与测试 三、系统优化与功…

SpringCloud篇(服务网关 - GateWay)

目录 一、简介 二、为什么需要网关 二、gateway快速入门 1. 创建gateway服务,引入依赖 2. 编写启动类 3. 编写基础配置和路由规则 4. 重启测试 5. 网关路由的流程图 6. 总结 三、断言工厂 四、过滤器工厂 1. 路由过滤器的种类 2. 请求头过滤器 3. 默认…

技术理论||02空中三角测量

空中三角测量指的是根据少量控制点坐标,利用空间前后交汇,对六个外方位要素进行解算,从而获得大量未知点坐标及图像外方位要素。空三测量精度是整个摄影测量过程中的关键环节,空三解算的精度直接影响到数字正射图像、实景三维模型等数字化成果的质量。在空三加密的平差解算中,主…

OpenTelemetry 赋能DevOps流程的可观测性革命

作者:天颇 引言 在当今快节奏的软件开发和运维环境中,DevOps 已经成为主流,它通过整合开发和运维流程,推动着软件的快速迭代和持续交付。然而,随着微服务、容器化和云计算等技术的普及,系统复杂性急剧增加…

大数据如何助力干部选拔的公正性

随着社会的发展和进步,干部选拔成为组织管理中至关重要的一环。传统的选拔方式可能存在主观性、不公平性以及效率低下等问题。大数据技术的应用,为干部选拔提供了更加全面、精准、客观的信息支持,显著提升选拔工作的科学性和公正性。以下是大…

风电电力系统低碳调度论文阅读第一期

在碳交易市场中,历史法和基准线法是用于分配碳排放配额的两种主要方法。以下是两种方法的公式及其解释: 区别总结 历史法:基于历史排放量,分配具有较强的公平性但可能缺乏激励减排。基准线法:基于行业基准和生产量&am…

PHP代码审计 --MVC模型开发框架rce示例

MVC模型开发框架 控制器Controller:负责响应用户请求、准备数据,及决定如何展示数据 模块Model:管理业务逻辑和数据库逻辑,提供链接和操作数据库的抽象层 视图View:负责前端模板渲染数据,通过html呈现给用户…

RT-Thread 星火1号学习笔记

LED 闪烁例程 硬件说明 LED 连接在开发板的某个 GPIO 端口上,通过控制该端口的高低电平来实现 LED 的亮灭。 软件说明 初始化 GPIO 端口 /* 配置 LED 灯引脚 */ #define PIN_LED_B GET_PIN(F, 11) // PF11 : LED_B --> LED #defi…

c++调用 c# dll 通过 clr (详细避坑)

项目场景: .NET Framework 4.7.2 需要在纯C项目中调用C# 的DLL C# DLL 在.NET core 或者 .NET 8 中无法使用AOT正常导出DLL 解决方案: 通过 用 C/clr 项目中转 来调用 1.在c# .NET Framework项目中把接口写好, 这里不推荐使用 .NET 8&#…

【动手学深度学习Pytorch】1. 线性回归代码

零实现 导入所需要的包: # %matplotlib inline import random import torch from d2l import torch as d2l import matplotlib.pyplot as plt import matplotlib import os构造人造数据集:假设w[2, -3.4],b4.2,存在随机噪音&…

论文笔记(五十六)VIPose: Real-time Visual-Inertial 6D Object Pose Tracking

VIPose: Real-time Visual-Inertial 6D Object Pose Tracking 文章概括摘要I. INTRODACTIONII. 相关工作III. APPROACHA. 姿态跟踪工作流程B. VIPose网络 文章概括 引用: inproceedings{ge2021vipose,title{Vipose: Real-time visual-inertial 6d object pose tra…

web——upload-labs——第三关——后缀黑名单绕过

上传一个正常的一句话木马,判断一下验证类型 响应后返回提示不允许上传.asp,.aspx,.php,.jsp后缀文件! 且查看网页源代码中并没有前端验证机制,所以可以判断这道题是后端验证 使用burp 提示无法上传.php结尾的文件,但我们的一句…

LeetCode题解:18.四数之和【Python题解超详细】,三数之和 vs. 四数之和

题目描述 给你一个由 n 个整数组成的数组 nums ,和一个目标值 target 。请你找出并返回满足下述全部条件且不重复的四元组 [nums[a], nums[b], nums[c], nums[d]] (若两个四元组元素一一对应,则认为两个四元组重复): …

如何利用SAP低代码平台快速构建企业级应用?

SAP作为全球领先的企业管理软件解决方案提供商,一直致力于为企业提供全面且高效的业务管理工具。随着技术的快速发展,传统的开发方式已经无法满足企业在快速变化的市场环境下的需求。低代码开发平台应运而生,它通过简化应用程序的创建过程&am…

Redis基础篇

文章目录 1.Redis的引入2.单机和分布式3.读写分离4.缓存服务器5.微服务 1.Redis的引入 我们的这个redis就是对于这个内存数据进行存储的,和我们的这个变量的这个性质是一样的,但是我们的这个redis主要是应用于这个分布式的这个系统上面的,如…

C++11(四)---可变参数模板

文章目录 可变参数模板 可变参数模板 参数包代表多个类型和参数 // Args是一个模板参数包&#xff0c;args是一个函数形参参数包 // 声明一个参数包Args...args&#xff0c;这个参数包中可以包含0到任意个模板参数。 template <class ...Args> void ShowList(Args... arg…

基于Springboot+Vue的中国蛇类识别系统 (含源码数据库)

1.开发环境 开发系统:Windows10/11 架构模式:MVC/前后端分离 JDK版本: Java JDK1.8 开发工具:IDEA 数据库版本: mysql5.7或8.0 数据库可视化工具: navicat 服务器: SpringBoot自带 apache tomcat 主要技术: Java,Springboot,mybatis,mysql,vue 2.视频演示地址 3.功能 这个系…

大数据新视界 -- 大数据大厂之 Impala 性能飞跃:分区修剪优化的应用案例(下)(22 / 30)

&#x1f496;&#x1f496;&#x1f496;亲爱的朋友们&#xff0c;热烈欢迎你们来到 青云交的博客&#xff01;能与你们在此邂逅&#xff0c;我满心欢喜&#xff0c;深感无比荣幸。在这个瞬息万变的时代&#xff0c;我们每个人都在苦苦追寻一处能让心灵安然栖息的港湾。而 我的…

ES6标准-Promise对象

目录 Promise对象的含义 Promise对象的特点 Promise对象的缺点 Promise对象的基本用法 Promise对象的简单例子 Promise新建后就会立即执行 Promise对象回调函数的参数 Promise参数不会中断运行 Promise对象的then方法 Promise对象的catch()方法 Promise状态为resolv…

【目标检测】【Ultralytics-YOLO系列】Windows11下YOLOV5人脸目标检测

【目标检测】【Ultralytics-YOLO系列】Windows11下YOLOV5人脸目标检测 文章目录 【目标检测】【Ultralytics-YOLO系列】Windows11下YOLOV5人脸目标检测前言YOLOV5模型运行环境搭建YOLOV5模型运行数据集准备YOLOV5运行模型训练模型验证模型推理 总结 前言 Ultralytics YOLO 是一…