-
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
-
CPP_Tabu-search-algorithm
禁忌搜索算法C/C++源代码,以禁忌表形式来搜索和禁忌以搜寻最优解(The taboo search Algorithm C/C++ in source code form of taboo table to search for and contraindications to search optimal solution)
- 2013-01-10 22:15:24下载
- 积分:1
-
《PRML(中文版)》
说明: 入门人工智能的书籍PRML,模式识别与机器学习(Pattern Recognition and Machine Learning)
- 2020-06-19 15:20:02下载
- 积分:1
-
Program-controlled_voltage_and_current_sources
通过单片机按键选择输出信号类型及要求输出量,在LED显示器件上指示信号类型及设定数值.系统工作电源±15V , ±5V 。恒流电流输出0.0~8.0mA, 负载电阻≤500Ω。3. 稳压电压输出0.0~5.0V,电流负载能力≤100mA.电压及电流输出在充许负载范围内误差小于5%FS。电压及电流输出须共用一个输出正端, 输出负端为地。输出电压及电流设定精确到二位十进制数。
(Through Singlechip button to choose the type and requirements of the output signal output, in the LED display on the instructions of the signal type and set the value. System power supply ± 15V, ± 5V. Constant current output 0.0 ~ 8.0mA, the load resistance ≤ 500Ω. 3. Regulator output voltage 0.0 ~ 5.0V, current load capacity ≤ 100mA. Voltage and current output in the framework allow the load error is less than 5 FS. Output voltage and current output is required to share a client, the output of negative side for the land. Output voltage and current settings accurate to two decimal number.)
- 2008-04-27 12:47:49下载
- 积分:1
-
lwip-1.3.2
LWip-1.3.2 网络协议 瑞典实验室最新IP协议栈(LWip-1.3.2 Laboratory of the latest IP network protocol stack, Sweden)
- 2011-05-27 13:56:49下载
- 积分:1
-
C#
- 2022-01-25 22:25:15下载
- 积分:1
-
222223
酒店门锁控制系统,制卡,退房退卡等操作,客房关系系统(Hotel door lock control systems, card, check out withdrawal card operation)
- 2014-03-27 18:00:48下载
- 积分:1
-
c# 投票网站完整源码下载(含数据库)
入门级的实例 大家多多交流学习
- 2014-03-10下载
- 积分:1
-
104protocol
104规约测试程序,经过现场检验实践过的,很好用,编译环境VC6(104 statute test procedure, after the test of practice, very friendly, compile environment VC6
)
- 2012-03-10 16:31:00下载
- 积分:1
-
image
基于msp430f2618的lcd的液晶图形显示程序(Based on msp430f2618 the lcd LCD graphics display program)
- 2012-07-26 17:22:40下载
- 积分:1