找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3799|回复: 0
打印 上一主题 下一主题
收起左侧

STM32学习之一 - 计频器设计原理

[复制链接]
跳转到指定楼层
楼主
ID:51025 发表于 2014-8-29 17:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
检测外部脉冲信号频率方法有三种:
(1)  TIM3 is configured in Input Capture Mode: the external signal is connected to
TIM3 Channel2 used as input pin.
To measure the frequency we use the TIM3 CC2 interrupt request,
so In the TIM3_IRQHandler routine, the frequency of the external signal is computed.
The "TIM3Freq" variable contains the external signal frequency:
TIM3Freq = TIM3 counter clock / Capture in Hz,
where the Capture is the difference between two consecutive TIM3 captures.
For Low-density, Medium-density, High-density and Connectivity line devices,
the minimum frequency value to measure is 1100 Hz.
For Low-Density Value line, Medium-Density and High-Density Value line devices,
the minimum frequency value to measure is 366 Hz.
(2)  TIM3 is configured in PWM Input Mode: the external signal is connected to
TIM3 Channel2 used as input pin.
To measure the frequency and the duty cycle we use the TIM3 CC2 interrupt request,
so In the TIM3_IRQHandler routine, the frequency and the duty cycle of the external
signal are computed.
The "Frequency" variable contains the external signal frequency:
Frequency = TIM3 counter clock / TIM3_CCR2 in Hz,
The "DutyCycle" variable contains the external signal duty cycle:
DutyCycle = (TIM3_CCR1*100)/(TIM3_CCR2) in %.
For Low-density, Medium-density, High-density and Connectivity line devices,
the minimum frequency value to measure is 1100 Hz.
For Low-Density Value line and Medium-Density Value line devices, the minimum
frequency value to measure is 366 Hz.
3)对于High-density devices(大容量型)如果检测脉冲的频率小于1100Hz,我们可以采用外部中断边沿的触发方式来计算脉冲的个数,通过定时器准确定时1s所测得的脉冲个数即为脉冲信号周期。

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表