- 简述:
- 8S系统默认时钟为内部16Mhz,8分频;
- 设为内部时钟:只需调整分频值即可;
- 设为外部时钟:待验证;
- 8S系统默认时钟为内部16Mhz,8分频;
- 主时钟源分类:
- 1-24MHz高速外部晶体振荡器(HSE)
- 最大24MHz高速外部时钟信号(HSE user-ext)
- 16MHz高速内部RC振荡器(HSI)
- 128KHz低速内部RC(LSI)
- 各个时钟源可单独打开或关闭,从而优化功耗;
- 时钟源切换----详见《STM8S微控制器参考手册---P47》
- 手动切换
- 软件设置时钟源切换;
- 自动切换
- 32中设置优先从外部时钟启动,启动失败切换到内部时钟;8S应该相同;无验证,只是猜想;
- 手动切换
- 时钟寄存器
- 内部时钟寄存器---CLK_ICKR
- 外部时钟寄存器---CLK_ECKR
- 主时钟状态寄存器---CLK_CMSR
- 主时钟切换寄存器---CLK_SWR
- 切换控制寄存器---CLK_SWCR
- 时钟分频寄存器——CLK_CKDIVR
- 外设时钟门控寄存器1——CLK_PCKENR1
- 外设时钟门控寄存器2——CLK_PCKENR2
- 时钟安全系统寄存器——CLK_CSSR
- 可配置时钟输出寄存器——CLK_CCOR
- CAN外部时钟控制寄存器——CLK_CANCCR
- HSI时钟修正寄存器——CLK_HSITRIMR
- SWIM时钟控制寄存器——CLK_SWIMCCR
- 总结:
- 如果用库函数配置系统时钟相对简单:
- CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV8);
- 设置为内部时钟,不分频,系统时钟:16M;
- CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV8);
- 寄存器配置系统时钟
- CLK_CKDIVR &= 0x00;//不分频
- 8S默认使用内置时钟
- 如果用库函数配置系统时钟相对简单:
- 工具篇:
- 有两种开发工具:
- ST Visual Develop Version 4.3.2
- IAR
- 有两种开发工具:
- 参考资料:
- 风驰开源STM8寄存器版本例程
- STM8中文参考手册
- STM8数据手册
- STM8S库函数中文参考.exe
- 程序
- 库函数
- 寄存器(本笔记依据寄存器编写)
相关推荐
STM8S(105K4)使用笔记——系统时钟的基础配置
0、STM8s105在系统复位后默认开启HSI,同时进行8分频 可以通过查看 寄存器CLK_ICKR为0x03(HSI使能) 寄存器CLK_CKDIVR为0x18(HSI分频为8分频) 1、初始化 使能HSI(系统初始化后HSI默认使能) CLK->ICKR |= 0x01; 禁用HSI CLK->ICKR &= (uint8_t)(~0x01); 使能LSI(若需...
STM8 时钟源切换
STM8时钟源:1、1~24MHz的高速外部晶体振荡器(HSE),即外部晶振 2、1~24MHz的高速外部时钟信号(HSE), 3、16MHz的高速内部RC振荡器(HSI) 4、128KHz的低速内部RC振荡器(LSI) 默认时钟源:由上述时钟框图,可以分析得知,16MHz HSI RC振荡器经过一个分频器,将时钟信号输出到主时钟选择器。单片机上电后默认该分频器的值为8分频,即单片机上电主时
STM32-时钟篇以及复位时时钟的配置过程
时钟就是一个芯片的心脏,CPU的处理速度也是由时钟来直接决定,相比51单片机单一的时钟源,STM32具有强大的时钟系统,我们的所有的外设都离不开时钟,时钟是学习STM32非常重要的部分。
STM8S 时钟配置源码程序
型号:stm8s903k3 编译器:STVD4.3.5+cosmic 8k 5.4.1 其他:采用操作寄存器,不使用库 ----------------- 时钟是单片机的灵魂,所有的东西都和时钟有关。相比AVR反人类的熔丝位设置时钟/振荡源。stm只要操作寄存器就可以了。最关键的是!!就算设置错了也不!会!锁!死! ---------------- stm内部时钟示意图。
STM8S003F3 开发环境搭建
板上硬件图+开发环境的搭建
STM8S简介
<br /> 从十一月份开始要学习STM8单片机了,在接下来的日子里我会把我的学习心得记录下来,希望可以帮到有需要的人!呵呵!下面进入正题首先介绍一下STM8的一些特性(介绍针对STM8S105C6):<br /> 一、内核<br /> 1.高级STM8内核,具有3级流水线的哈佛结构 <br /> 2.扩展指令集 <br /> 二、存储器<br /> 1.中等密度程序和数据存储器:最多32K字节Flash;10K次擦写后在55°C环境下数据可保存20年 <br />
STM8S之时钟设置
昨天被安排做别的工作,耽误一天,今天继续写,坚持学习。 1,STM8S的4种时钟源可用做主时钟: ● 1-24MHz高速外部晶体振荡器(HSE) ● 最大24MHz高速外部时钟信号(HSE user-ext) ● 16MHz高速内部RC振荡器(HSI) ● 128KHz低速内部RC(LSI) 各个时钟源可单独打开或关闭,从而优化功耗。 2,系统的启动 为使系统快速启动,复...
STM8开发实例-时钟系统(CLK)
在 STM8中,有三个主要的时钟源——高速内部时钟 (HSI)、高速外部时钟 (HSE) 和低速内部时钟 (LSI)。
STM32 时钟树(基于 STM32F407)
STM32 内部也是由多种多样的电路模块组合在一起实现的。当一个电路越复杂,在达到正确的输出结果前,它可能因为延时会有一些短暂的中间状态,而这些中间状态有时会导致输出结果会有一个短暂的错误,这叫做电路中的“毛刺现象”,如果电路需要运行得足够快,那么这些错误状态会被其它电路作为输入采样,最终形成一系列的系统错误。
STM8S单片机入门:基础知识与源代码示例
STM8S单片机是STMicroelectronics推出的8位微控制器系列。它拥有高性能的处理能力,适用于广泛的应用领域,如工业控制、汽车电子、家电等。采用8位处理器核心,运行频率可达到20MHz。内置的闪存和RAM,用于存储程序代码和数据。提供多种外设接口,如通用输入输出口(GPIO)、模拟到数字转换器(ADC)、串行通信接口(UART、SPI、I2C)等。低功耗设计,适用于电池供电的应用。开发工具链完善,支持多种编程语言和开发环境。
加权余量法求解偏微分方程
加权余量法(Weighted Residual Method)是一种数值方法,用于求解偏微分方程(PDEs)。其基本思想是将偏微分方程的残差(或余量)通过加权函数加权,并使加权余量在定义域上为零,从而形成一组代数方程进行求解。
STM8 主时钟源
STM8S 单片机可以选择 4 种时钟源作为主时钟fFMASTER ● 1-24MHz高速外部 晶体振荡器(HSE) ● 最大24MHz高速外部 时钟信号(HSE user-ext) ● 16MHz高速内部RC振荡器(HSI) ● 128KHz低速内部RC(LSI) 各个时钟源可单独打开或关闭,从而优化功耗。 HSE (High Speed External) 高速外部时钟信号可由下面两个时钟源...
星载SAR系统参数设计过程自动化方法研究
本文提出了一种 SAR系统参数自动化设计的 方法。首先,针对部分参数仍需手工选取的现状 建立了最优化求解模型,并给出了 PRF 和波位位 置的优化选取结果,使参数设计流程更加高效便 捷。然后,针对 SAR 系统参数设计过程中部分技 术指标的评测结果不满足用户需求时无法自动调 节的现状,采用 PID 控制器对方位向天线尺寸、信 号带宽、PRF 等参数进行自动调节,使得方位分辨 率、距离分辨率、方位模糊比等技术指标向用户需 求值逐步靠近。通过仿真实验验证了该方法的可 行性,实现了SAR系统参数设计过程的自动化
STM8S207时钟管理库函数
STM8S207时钟管理库函数
Windows 2012 SYSVOL复制失败的处理
题外话:晓原理、知架构、查日志是排错的三件法宝今天在DC1上新建并链接了一个组策略对像,在客户端刷新时,却报下面的错误:“处理组策略失败。Windows无法应用组策略对象LDAP….”如下图所示:于是在客户端用\\domain.com访问,发现\\domain.com\SYSVOL\domain.com\policies下面没有上面报错的组策略对象。这是怎么一回事呢,pin...
开源大模型本地部署实战:Llama、DeepSeek、Qwen选型与工程落地指南
大语言模型(LLM)本地部署已成为AI工程化核心环节,其本质不是比拼参数量或榜单分数,而是考察模型架构、推理引擎、量化支持、IDE集成与多模态扩展能力的系统性适配。Llama以纯净Transformer结构成为通用底座,依赖llama.cpp和GGUF量化实现跨平台轻量推理;DeepSeek深度优化代码与数学推理,通过原生OpenAPI、FlashAttention-2及tensor parallelism显著降低API延迟;Qwen则采用模块化设计,支持视觉编码器(Qwen-VL)、生物计算(Qwen-B
STM8 时钟切换
HSE、HSI、LSI 都可以作为系统主时钟源,STM8 单片机复位以后默认 HSI 的 8 分频作为系统主时钟,其原因是 HSI 稳定时间短,而其 8 分频又可以保证系统在较差的 VDD 条件下安全启动。在系统运行的过程中可以切换系统的主时钟源。系统时钟源的切换有 2 种方式:自动切换、手动切换。 自动切换可以使用最少的指令来完成主时钟源的切换,用户程序可以处理其他事物而不用关心确切的切...
常见消息队列:ActiveMQ、RabbitMQ、RocketMQ、Kafka的区别总结
常见消息队列:ActiveMQ、RabbitMQ、RocketMQ、Kafka的区别。
STM8库函数开发手册(1) //工程模板、GPIO、时钟
第一部分 创建库函数工程 1、创建文件目录 BSP文件夹中存放自定义底层驱动程序文件; IAR文件夹存放IAR工程文件; LIB 文件夹中引入C 语言自己的库函数; USR 文件夹中存放自定义主程序及数据库头文件等; Readme 文件夹中存放自...
vue2/3 - 详细对接海康监控实时视频预览和录像回放功能,vue接入使用海康视频监控播放器实时推流等功能,支持hik/rtsp/rtmp/hls/ws取流协议(详细教程与示例代码,一键复制开箱即用
vue2,vue3,海康,vue海康视频监控,海康开放平台,如何接入海康的实时监控,海康威视,Vue实现海康监控视频播放,vue3对接海康视频监控播放、回放的方法流程,实现海康H5视频插件播放视频的实例,web网页接入海康,海康威视的视频vue的录像回放和实时预览,前端vue3项目接入海康威视h5player.js播放器,vue2接入海康威视视频监控平台,使用海康监控H5视频播放,对接海康视频监控,海康视频web插件,web前端在vue中通过海康插件嵌入视频,实现实时预览,vue3海康监控播放器组件,vue
STM8 时钟寄存器
STM8S 的时钟管理可以通过对 13 个寄存器的设置来实现,它们是 ● 内部时钟寄存器 CLK_ICKR ● 外部时钟寄存器 CLK_ECKR ● 主时钟状态寄存器 CLK_CMSR ● 主时钟切换寄存器 CLK_SWR ● 切换控制寄存器 CLK_SWCR ● 时钟分频寄存器 CLK_CKDIVR ● 外设时钟门控寄存器 1CLK_PCKENR1 ● 外设时钟门控寄存器 2CLK_PCKENR...
IMSL CNL 7.0.0 (x86-64)Crack
IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件
STM8S_001_GPIO基础知识
推荐 分享一个大神的人工智能教程。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到人工智能的队伍中来!http://www.captainbed.net/strongerhuang Ⅰ、写在前面 完事开头难,只要肯努力;师傅领进门,修行看个人;当你看到本文,说明你是幸运的,作者接下来推出的一系列STM8S教程,将助你踏入STM8S的世界。 本文是STM8S教程的开始...
深度学习工具包 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');```[](https://bitdeli.com/free "Bitdeli Badge")
IEM模型,地表粗糙度模拟
利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟
stm8s_atomthread
STM8S实时操作系统使用教程(内部版)介绍1.嵌入式操作系统基本知识 嵌入性、专用性与计算机系统是嵌入式系统的基本元素;跟通用计算机系统(如windows、linux等)相比,嵌入式系统具备专用性强、可剪裁性好、实时性好和功耗低的特点。 实时操作系统满足条件: 必须是多任务(任务调度或调度器,最核心功能) 任务的切换时间与系统当前任务数无关(调度器对任务切换时间) 中断延时的时间可预知并尽可能短
Outlook Express 6 (OE6) for Win7/Win8/Win10
英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。
1301



被折叠的 条评论
为什么被折叠?



