-
example6_TIM
本例展示了如何设置TIM,用它来测量一个外部输入信号的频率和占空比。
TIM2时钟设置为72MHz,预分频设置为0,TIM2计数器时钟可表达为:
TIM2 counter clock = TIMxCLK / (Prescaler +1) = 72 MHz,因此可测量的最小频率值为1100Hz。
设置TIM2工作在PWM输入模式(PWM Input Mode),把外部信号作为输入连接到TIM2通道2。
利用TIM2计数器中断来测量信号的频率和占空比。在TIM2_IRQHandler中,计算信号的频率和占空比,方法如下:
变量"Frequency"为由下式得到的外部信号频率:
Frequency = TIM2 counter clock / TIM2_CCR2 单位Hz
变量"Duty_Cycle"为由下式得到的外部信号占空比:
Duty_Cycle = (TIM2_CCR1*100)/(TIM2_CCR2) 单位
(This example shows how to set up the TIM, and use it to measure the frequency and duty cycle of an external input signal. TIM2 clock set to 72MHz and the prescaler is set to 0, TIM2 is counter clock can be expressed as: TIM2 is counter clock = TIMxCLK/(prescaler. Ppls1) = 72 MHz, the minimum measurable frequency value of 1100 Hz. Set TIM2 PWM input mode (PWM Input Mode), the external signal as an input connected to the the TIM2 Channel 2. TIM2 counter interrupt signal to measure frequency and duty cycle. Calculate the frequency and duty cycle of the signal in TIM2_IRQHandler as follows: variable " Frequency" on the grounds of the external signal frequency by the following formula: Frequency = TIM2 is counter clock/TIM2_CCR2 unit Hz variable Duty_Cycle " on the grounds of the following formula to get external duty cycle: Duty_Cycle = (TIM2_CCR1* 100)/(TIM2_CCR2) in )
- 2012-05-18 18:28:47下载
- 积分:1
-
LABjs-2.0.3
LABjs 的核心是 LAB(Loading and Blocking):Loading 指异步并行加载,Blocking 是指同步等待执行。LABjs 通过优雅的语法(script 和 wait)实现了这两大特性,核心价值是性能优化。LABjs 是一个文件加载器。(LABjs lets you load pretty much any script file, whether you control it or not, with no intrusion or convention for dependencies, other than the order and blocking that you define. It keeps track of what you ve asked for and what has downloaded, and lets you only define a handler once for a group of scripts that will execute together in parallel. The API style (with chaining) makes is very easy to convert a set of script tags in your page into code to load them, without having to worry that race conditions will cause issues for scripts loading in the wrong order if there are explicit dependencies involved.)
- 2014-01-09 15:15:47下载
- 积分:1
-
2010.08.02
基本调节功能的电子钟 断电记忆 只为测试24C02(Basic regulatory function of the electronic clock off memory only for the test 24C02)
- 2010-08-12 08:41:32下载
- 积分:1
-
C8051F34
说明: 最新超低功耗,超高速 51单片机的资料.非常难得.(a new ultra-low power consumption,ultra high speed 51 signal-chip book.)
- 2010-03-26 20:52:38下载
- 积分:1
-
192.STM32-超声波测距
说明: 使用单片机利用超声波测距,里面包括源代码(Using Single Chip Microcomputer to Measure Distance by Ultrasound)
- 2020-06-25 21:00:02下载
- 积分:1
-
小学期电信16-1秦毫
oled屏幕上面显示时分秒,可自行控制暂停(Time and seconds are displayed on the OLED screen, and the pause can be controlled by itself.)
- 2019-01-06 12:14:10下载
- 积分:1
-
ads1118
说明: 本资料是用来开发ADS1118的中文手册资料, 可以用此写stm32程序(The DATE Is FOR THE ads1118 for the stm32)
- 2020-06-23 04:00:01下载
- 积分:1
-
2DFT
以上是二维傅里叶变换程序源代码 还有傅里叶反变换(These are the two-dimensional Fourier Transform source code for inverse Fourier transform)
- 2012-05-27 13:58:55下载
- 积分:1
-
ad7730_1723
Source for AD7730 for cell stage input doses tensometry
- 2011-01-05 17:18:48下载
- 积分:1
-
TLS3001(2012-11-10)
STC单片机驱动TLS3001LED芯片源码(STC microcontroller chip driver source TLS3001LED)
- 2013-11-20 19:11:29下载
- 积分:1