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.xdnf.cn/news/18243.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

Redis设计与实现 学习笔记 第十八章 发布与订阅

第18到24章是本书第四部分:独立功能的实现。 Redis的发布与订阅功能由PUBLISH、SUBSCRIBE、PSUBSCRIBE等命令组成。 通过执行SUBSCRIBE命令,客户端可订阅一个或多个频道,从而成为这些频道的订阅者(subscriber)&#…

小程序-基于java+SpringBoot+Vue的驾校预约平台设计与实现

项目运行 1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境&#xff1a…

python多版本管理 windows11 pyenv

前言 需要开发多个项目,但各个项目的版本不一致怎么办?python -m venv 只解决了依赖隔离问题,但venv本身并没有办法提供多个python版本。因此我们要引入pyenv来解决。 安装pyenv https://pyenv-win.github.io/pyenv-win/ 安装很简单&…

01.防火墙概述

防火墙概述 防火墙概述1. 防火墙的分类2. Linux 防火墙的基本认识3. netfilter 中五个勾子函数和报文流向 防火墙概述 防火墙( FireWall ):隔离功能,工作在网络或主机边缘,对进出网络或主机的数据包基于一定的 规则检…

Excel表格解析为QTableWidget

解析表格 头文件 #ifndef MAINWINDOW_H #define MAINWINDOW_H#include <QMainWindow> #include <QAxObject> #include <QTableWidget> #include <QTableWidgetItem> #include <QDebug> #include <QSet> #include <QPoint> #include…

华为欧拉系统使用U盘制作引导安装华为欧拉操作系统

今天记录一下通过U盘来安装华为欧拉操作系统 华为欧拉操作系统是国产的一个类似于Centos的Linus系统 具体实现操作步骤&#xff1a; 先在官网下载欧拉系统镜像点击跳转到下载 准备好一个大于16g的U盘 &#xff0c;用于制作U盘启动 下载一个引导程序制作工具&#xff0c;我使用…

魔改log4j2的JsonLayout,支持自定义json格式日志

小伙伴们&#xff0c;你们好&#xff0c;我是老寇&#xff0c;我又回来辣&#xff0c;1个多月不见甚是想念啊&#xff01;&#xff01;&#xff01;跟我一起魔改源码吧 1.自定义json格式【PatternLayout】 大部分教程都是这个&#xff0c;因此&#xff0c;我就简单给个配置&a…

机器学习—学习曲线

学习曲线是帮助理解学习算法如何工作的一种方法&#xff0c;作为它所拥有的经验的函数。 绘制一个符合二阶模型的学习曲线&#xff0c;多项式或二次函数&#xff0c;画出交叉验证错误Jcv&#xff0c;以及Jtrain训练错误&#xff0c;所以在这个曲线中&#xff0c;横轴将是Mtrai…

在MATLAB中实现自适应滤波算法

自适应滤波算法是一种根据信号特性自动调整滤波参数的数字信号处理方法&#xff0c;其可以有效处理噪声干扰和信号畸变问题。在许多实时数据处理系统中&#xff0c;自适应滤波算法得到了广泛应用。在MATLAB中&#xff0c;可以使用多种方法实现自适应滤波算法。本文将介绍自适应…

【系统编程】实验7 消息队列

设计程序 使用消息队列实现两个进程之间的信息互通 snd.c #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/msg.h> #include <unistd.h>/*消息发送者 */// 消息结构体如下&#xff1a; …

ETH钱包地址如何获取 如何购买比特币

首先我们要先注册一个交易所 Gate.io&#xff08;推荐&#xff09;: 点我注册 1、注册很简单&#xff0c;通过手机号就可以进行注册了。 2、获取ETH钱包地址 注册好之后&#xff0c;如图所示&#xff0c;点击“统一账户” 3、通过搜索栏搜索ETH&#xff0c;如下图所示 4、点…

[Docker#11] 容器编排 | .yml | up | 实验: 部署WordPress

目录 1. 什么是 Docker Compose 生活案例 2. 为什么要使用 Docker Compose Docker Compose 的安装 Docker Compose 的功能 使用步骤 核心功能 Docker Compose 使用场景 Docker Compose 文件&#xff08;docker-compose.yml&#xff09; 模仿示例 文件基本结构及常见…

OpenCV基础(1)

1.图像读写与窗口显示 1.1.imread读取图像文件 Mat cv::imread(const string &filename,int flags IMREAD_COLOR); filename&#xff1a;要读取的图像文件名flags&#xff1a;读取模式&#xff0c;可以从枚举cv::ImreadModes中取值&#xff0c;默认取值是IMREAD_COLOR&am…

【优选算法篇】分治乾坤,万物归一:在重组中窥见无声的秩序

文章目录 分治专题&#xff08;二&#xff09;&#xff1a;归并排序的核心思想与进阶应用前言、第二章&#xff1a;归并排序的应用与延展2.1 归并排序&#xff08;medium&#xff09;解法&#xff08;归并排序&#xff09;C 代码实现易错点提示时间复杂度和空间复杂度 2.2 数组…

生产环境centos8 Red Hat8部署ansible and 一键部署mysql两主两从ansible脚本预告

一、各节点服务器创建lvm逻辑卷组 1.初始化磁盘为物理卷&#xff08;PV&#xff09; 命令&#xff1a;sudo pvcreate /dev/vdb 2.创建卷组&#xff08;VG&#xff09; 命令&#xff1a;sudo vgcreate db_vg /dev/vdb 3.创建逻辑卷&#xff08;LV&#xff09; 命令&#xff1a;s…

CNN神经网络

CNN 一 基本概述二 基础知识三 经典案例 今天跟大家聊聊人工智能中的神经网络模型相关内容。神经网络内容庞大,篇幅有限本文主要讲述其中的CNN神经网络模型。 一 基本概述 深度学习(Deep Learning)特指基于深层神经网络模型和方法的机器学习。它是在统计机器学习、人工神经网…

【Ubuntu24.04】VirtualBox安装ubuntu-live-server24.04

目录 0 背景1 下载镜像2 安装虚拟机3 安装UbuntuServer24.044 配置基本环境5 总结0 背景 有了远程连接工具之后,似乎作为服务器的Ubuntu24.04桌面版有点备受冷落了,桌面版的Ubuntu24.04的优势是图形化桌面,是作为一个日常工作的系统来用的,就像Windows,如果要作为服务器来…

【策略模式】最佳实践——Spring IoC实现策略模式全流程深度解析

简介 策略模式是一种行为型设计模式&#xff0c;它定义了一系列算法&#xff0c;并将每一个算法封装起来&#xff0c;使它们可以互相替换&#xff0c;并且使算法的变化不会影响使用算法的客户端。策略模式通过将具体的业务逻辑从上下文&#xff08;Context&#xff09;中剥离出…

企业项目级IDEA设置类注释、方法注释模板(仅增加@author和@date)

文章目录 前言一 设置类注释1.1 添加模板1.2 复制配置 二 设置方法注释2.1 添加模版2.2 设置模版2.3 设置参数变量2.4 配置对应快捷键2.5 配置对应作用域2.6 使用方式 说明 前言 公司代码规范中&#xff0c;需要在标准JavaDoc注释的基础上加上作者和日期。网上虽然有很多现成的…

单片机学习笔记 2. LED灯闪烁

目录 0、实现的功能 1、Keil工程 2、代码实现 0、实现的功能 LED灯闪烁 1、Keil工程 闪烁原理&#xff1a;需要进行软件延时达到人眼能分辨出来的效果。常用的延时方法有软件延时和定时器延时。此次先进行软件延时 具体操作步骤和之前的笔记一致。此次主要利用无符号整型的范…