当前位置:网站首页>预分频值和自动重装值对中断频率的影响
预分频值和自动重装值对中断频率的影响
2022-07-26 22:48:00 【若木·】
ARR——自动重装器;
PSC——预分频器
这两个也是在决定TIM定时时间的参数,如果我们想定1s的时间,可以参考计数器溢出频率公式:CK_CNT_OV=CK_CNT/(ARR+1)=CK_PSC/(OSC+1)/(ARR+1)
也就是,定时频率=72M/(PSC+1)/(ARR+1)
定时1s,也就是定时频率为1hz,PSC给一个7200,ARR给一个10000,然后两个值再减1,因为预分频器和计数器都有1个数的偏差,所以要减去1
(注意PSC和ARR的取值都要在0~65535之间,不要超范围了)
预分频给少点,自动重装给多点,这样就是以一个比较高的频率计比较多的数;
如果预分频给多点,自动重装给少点,这样就是以一个比较迪的频率计比较少的数;
如果我们的自动重装值写的是10000-1,那么这个值就是从0一直自增到9999,总共是
10000个数,计数10000次,就是1s。
如果我们把10000改成1000,就是从院来计10000个数,变成了计1000个数,这时这个值就是从0加到999了,对应的是0.1s,在预分频值不变的情况下,值自增的速度也就比原来快了10倍
如果我们改回10000,把预分频值去掉一个0,那就是以原来10倍的计数频率计10000个数。
边栏推荐
- shell课程总结
- 解决方案:Win10如何使用bash批处理命令
- MySQL备份恢复
- Homework 1-4 learning notes
- 【数据库课程设计】SQLServer数据库课程设计(学生宿舍管理),课设报告+源码+数据库关系图
- 解决方案:读取两个文件夹里不同名的文件,处理映射不对应的文件
- 读写分离、主从同步一文搞定
- Text to image论文精读RAT-GAN:文本到图像合成中的递归仿射变换 Recurrent Affine Transformation for Text-to-image Synthesis
- Text to image intensive reading df-gan:a simple and effective baseline for text to image synthesis
- CEPH (distributed storage)
猜你喜欢

Machine learning exercise 7 - K-means and PCA (principal component analysis)

(hdu1588) Gauss Fibonacci (sum of matrix fast power + bisection matrix proportional sequence)
![[untitled]](/img/2a/53327cd39db7871fa780ed599420d0.png)
[untitled]

23nfs shared storage service

Unity Huatuo hot update environment installation and sample project

a元素的伪类

Share 29 chrome plug-ins, and there is always one for you

Hands on experiment of network and VPC
![[FPGA tutorial case 28] one of DDS direct digital frequency synthesizers based on FPGA -- principle introduction](/img/bf/ce4bc33d2a0fc7fe57105e20fbafcf.png)
[FPGA tutorial case 28] one of DDS direct digital frequency synthesizers based on FPGA -- principle introduction

Pseudo class of a element
随机推荐
7.13 蔚来提前批笔试
Text to image intensive reading df-gan:a simple and effective baseline for text to image synthesis
MySQL备份恢复
2022最新直播监控24小时监控(三)直播间弹幕解析
Connect mysql detailed graphic operations in ECs docker (all)
7.7 SHEIN希音笔试
[reprint] 6. Tensorrt advanced usage
--Project summary
25pxe efficient batch network installation
Docker高级篇之Mysql主从复制、Redis集群扩容缩容配置案例详解
[FPGA tutorial case 28] one of DDS direct digital frequency synthesizers based on FPGA -- principle introduction
为啥不建议使用Select *
Electron FAQ 61 - must the client run with administrator privileges?
行,表,页,共享,排他,悲观,乐观,死锁
[详解C语言]一文带你玩转函数
Solution to high collapse
Run NPM run dev to run 'NPM audit fix' to fix them, or 'NPM audit' for details
Realize data interaction between two apps through fileprovider
6.30滴滴面经(一面+二面)
指针常量与常量指针详细讲解