超频与稳定性:探索STM32F103时钟配置的边界与风险

超越72MHz:STM32时钟超频与稳定性优化的实践指南 本文深入探讨STM32微控制器的时钟超频技术,重点解析RCC时钟系统架构,提供从96MHz到128MHz的逐步超频实践指南。涵盖SYSCLK和HCLK配置优化、稳定性测试方案及电源热管理策略,帮助开发者在保证系统稳定性的前提下提升处理性能。 阅读详情

超频与稳定性:探索STM32F103时钟配置的边界与风险

对于嵌入式开发者而言,STM32F103这颗经典的Cortex-M3内核微控制器并不陌生。它默认运行在72MHz,但许多工程师可能不知道,通过合理的时钟配置,这颗芯片实际上可以超频至128MHz甚至更高。然而,超频不仅仅是简单地调整几个寄存器数值,它涉及到电源完整性、信号时序、热管理和系统稳定性的复杂平衡。在追求极致性能的硬件测试实验室环境中,每一个MHz的提升都需要精确的测量和严谨的验证。

1. STM32F103时钟架构深度解析

STM32F103的时钟树结构可以说是其核心架构中最精妙的设计之一。整个系统时钟SYSCLK可以通过多个源生成:内部高速RC振荡器HSI(8MHz)、外部高速晶体振荡器HSE(通常为8MHz)或主PLL输出PLLCLK。对于超频应用,PLLCLK无疑是最关键的部分。

PLL配置寄存器中的倍频因子PLLMUL可以设置为2到16的整数值,这意味着当使用8MHz外部晶振作为输入时,理论输出频率范围可达16MHz到128MHz。但需要注意的是,PLL输入频率范围有限制——官方规定PLL输入频率应在1-24MHz之间,输出频率不应超过72MHz(超频时可达128MHz)。

在实际超频配置中,我们通常使用标准库函数或直接寄存器操作来设置PLL参数:

// 使用标准外设库配置PLL为128MHz
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_16);
RCC_PLLCmd(ENABLE);

// 等待PLL就绪
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);

// 切换系统时钟源为PLL
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);

注意:超频操作前务必确保HSE时钟已经稳定运行,否则可能导致系统启动失败。建议先使能HSE并等待HSERDY标志位置位后再配置PLL。

STM32f103时钟树详解 ①、HSI 是高速内部时钟,RC 振荡器,频率为 8MHz;②、HSE 是高速外部时钟,可接石英/陶瓷谐振器,或者接外部时钟源,频率范围为 4MHz~16MHz。我们的开发板接的是 8M 的晶振。③、LSI 是低速内部时钟,RC 振荡器,频率为 40kHz。独立看门狗的时钟源只能是 LSI,同时 LSI 还可以作为 RTC 的时钟源。④、LSE 是低速外部时钟,接频率为 32.768kHz 的石英晶体。这个主要是 RTC 的时钟源。 阅读详情

相关推荐

STM32F103 RCC时钟配置详解:从HSE启动到72MHz系统时钟

在嵌入式系统中,时钟系统是CPU与外设协同工作的基础。理解RCC(复位与时钟控制)模块的原理,掌握HSE外部晶振启动、PLL倍频、总线预分频及Flash等待周期等关键环节,是实现稳定高性能运行的前提。本文围绕STM32F103系列,深入解析RCC时钟树结构、寄存器级配置逻辑与工程健壮性设计,涵盖HSE起振超时处理、PLL锁定检测、SYSCLK原子切换等核心技术点。内容兼顾底层寄存器操作与HAL库演进视角,适用于裸机开发、固件移植及可靠性调优场景,助力工程师规避常见时钟配置陷阱。

weixin_29317963的博客 328

STM32F103系统时钟配置与72MHz时钟树详解

系统时钟是嵌入式MCU运行的基准节拍,决定CPU性能、外设响应及系统稳定性。其核心原理基于多源振荡器(HSE/HSI)、锁相环(PLL)倍频、多级预分频器(HPRE/PPRE)构成的时钟树结构。正确配置需满足硬件时序约束:如Flash等待周期(Latency)随SYSCLK动态匹配,APB1总线限频36 MHz以保障ADC/I2C等外设可靠工作。技术价值体现在精准控制功耗、时序裕量与EMC表现;典型应用场景包括串口通信、定时器精确定时、高速ADC采样等。本文围绕STM32F103的SetSysClockTo

weixin_35749545的博客 232

stm32正点原子、野火笔记-时钟

一、stm32F103时钟树 1、stm32F103时钟系统图: 1.1stm32五个时钟源 在 STM32 中,有五个时钟源,为 HSI、HSE、LSI、LSE、PLL。从时钟频率来分可以分为 高速时钟源和低速时钟源,HIS、HSE 以及 PLL 是高速时钟,LSI 和 LSE 是低速时钟。 从来源可分为外部时钟源和内部时钟源,外部时钟源就是从外部通过接晶振的方式获取时 钟源,其中 HSE 和 LSE 是外部时钟源,其他的是内部时钟源。 标记:H-high S-speed I-int

xu_ciel的博客 1961

STM32F103时钟系统深度解析:RCC寄存器配置与工程实践

在嵌入式开发中,微控制器的时钟系统是决定系统稳定性、实时性与功耗表现的核心基础。它本质上是一套可编程的时钟生成、分频与路由网络,其原理涉及振荡源选择、锁相环倍频、多级总线预分频及硬件故障切换机制。技术价值体现在精准时序控制、低功耗模式支持与硬件级容错能力,广泛应用于工业控制、传感器采集、通信协议栈及RTC实时时钟等场景。本文聚焦STM32F103系列,深入剖析RCC(Reset and Clock Control)模块的寄存器级配置逻辑,结合HSE/HSI/LSE时钟源特性、PLL倍频约束、APB1/APB

weixin_29317963的博客 416

STM32F103C8T6超频120M.rar

有关于STM32F103C8T6最小系统核心板的超频至120M的代码,简单修改了system_stm32f10x.c。用LED灯做的测试。

SAP CKMLCP 月结7大常见报错:从“未找到成本核算运行”到“物料占用”的完整解决方案

本文深入解析SAP CKMLCP月结过程中的7大常见报错,从权限问题到数据一致性错误,提供系统化的解决方案。重点解决'未找到成本核算运行'和'物料占用'等典型问题,帮助财务人员高效完成成本核算月结,确保数据准确性。

weixin_30299709的博客 417

MSTAR数据集下载地址及处理方法

首先感谢博主冯子材提供下载的百度网盘地址。 在这里为了防止侵权,特此鸣谢,并给出其博客地址。 地址中有MSTAR百度网盘下载地址和需要使用的数据介绍,其中百度网盘中有数据转换工具 https://blog.youkuaiyun.com/taifengzikai/article/details/80600355 工具使用 因为下载得到的数据是二进制文件,需要使用官方提供的工具进行转换,可将其转换为jpeg。 有...

KamenRider 1万+

DRAM刷新refresh相关知识归类-基础小知识(三)

RAM每一位数据都是通过芯片内的一个小电容充电(或低电平)存储的。但随着时间的推移,电容逐渐失去电荷。为避免丢失存储的数据,必须定期刷新以将电荷(如果存在)恢复到其原始级别。此刷新过程包括读取每个位的值,然后将其写回。在此“刷新”期间,内存被占用,无法执行加载或存储位等正常操作。知道了应该这么做,但怎么去做以及有什么办法更有效率去做,就是接下来要整理的内容。

Paul 安的博客 1万+

从法律文档到知识图谱

这里我们定义了两个 Pydantic 模型:Location 用于捕捉结构化的地址信息,包含可选的国家、州和地址字段;Party 用于表示合同参与方,包含必填的名称和可选的位置详情。字段描述通过告知 LLM 每个字段具体需要查找哪些信息,来辅助提取过程。"""包含结构化地址组件的位置信息。"""country: Optional[str] = Field(None, description="国家")

Anspire的博客 3030

MATLAB新手必看:Stewart平台运动学逆解从入门到实战(附完整代码)

本文详细介绍了如何使用MATLAB实现Stewart平台的运动学逆解,从基础原理到完整代码实现,涵盖并联机器人的数学建模、MATLAB编程和Simulink集成。通过实战案例和可视化分析,帮助新手快速掌握Stewart平台的运动学逆解技术,适用于机器人学和控制理论领域的研究与应用。

dream的博客 551

别再硬编码了!Flowable工作流动态审批人配置全解析(Spring Boot集成版)

本文深入解析Flowable工作流在Spring Boot中的动态审批人配置技术,通过角色、部门等变量实现审批流程的灵活设计。文章详细介绍了架构原理、前端配置映射、动态候选组解析及查询优化方案,帮助企业提升审批流程的适应性和维护效率。

weixin_30919571的博客 136

Isaac Sim 车辆动力学:从参数调优到户外仿真的挑战与实战

本文深入探讨了Isaac Sim在车辆动力学仿真中的应用,从参数调优到户外场景模拟的实战经验。详细解析了悬架系统、轮胎物理模型等核心参数的设置技巧,并分享了应对户外仿真挑战的实用方案。通过Vehicle Wizard高级使用和传感器配置,帮助开发者高效完成车辆仿真与算法开发。

weixin_29192211的博客 404

android 运动目标检测_MindSpore应用案例:AI对篮球运动员目标的检测

MindSpore作为一个端边云协同的开源的全场景AI框架,今年3月份开源以来,受到了业界的广泛关注和应用,欢迎大家参与开源贡献、模型众智合作、行业创新与应用、学术合作等,贡献您在云侧、端侧 (HiMindSpore 应用程序)、边侧以及安全领域的应用案例。MindSpore与您在AI领域共同成长,让AI使能千行百业,释放出强大的生产力。本文讲述的是MindSpore对篮球运动员目标的检测应用,通...

weixin_33603813的博客 835

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: LVGL9.3在嵌入式屏显中的性能优化实战:IPA加速与软硬件协同设计
下一篇: 超越UART:TMS320F28335 SCI FIFO与中断机制的高效数据流优化
java5
博客等级 码龄22年 85粉丝 2103原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值