1、基于单片机的数字频率计设计 I 摘要 频率信号具有抗干扰能力强、易于传输、测量精度高等优点,因此在实际测 量系统中,经常通过测量待测信号频率达到测量其他参量的目的。本文简要介绍 了几种数字频率计的设计方案,其中基于单片机的数字频率计设计方案,具有硬 件简单、易于调试、扩展能力强等优点。 本文设计的数字频率计采用脉冲数定时测频法测量频率。数字频率计以单片 机为核心,主要分为放大电路、波形变换和整形电路、分频电路、单片机和数据 显示电路组成,设计以单片机为核心,被测信号先进入信号放大电路进行放大, 再被送到波形整形电路整形,把被测的正弦波或者三角波整形为方波。利用单片 机的计数器和定时器的功能对被
2、测信号进行计数。编写相应的程序可以使单片机 自动调节测量的量程,并把测出的频率数据送到显示电路显示。 关键词关键词 数字频率计,单片机,测量频率 Abstract Frequency signal has a strong anti-jamming capability, easy to transport and the advantages of high measurement precision, so in the actual measuring system, often through measuring for the signal frequency achieve the
3、 purpose of measuring other parameters.This paper presents the design of digital frequency meter, focusing on many alternatives to microcontroller as control core,Realize the digital frequency for frequency measurement project design,its hardware design is simple and easily debugging,and has expansi
4、on ability. Selected design ideas which directly measuring frequency law in the high-band and testing cycle law in the low-band.The hardware partially is composed by enlarged circuit ,the profile transformation and the reshaping circuit ,the gate at the base control circuits ,sub-frequency circuits,
5、the microcontroller and the date display electrice cricuit; The software design is achieved by many functional modules,such as the signal II frequency measurement module,the signal cycle survey module,timer interruption of service module,the data display module and so-on. Achieving counting function
6、 and conversion between cycle and frequency by using control functions and mathematics operation ability of microcontroller.Like these the survey scope can achieve 1HZ-10MHZ. Key Words digital frequency meter, microcontroller, frequency measurements 基于单片机的数字频率计设计 III 目录 摘要 . I Abstract I 目录 .III 1 绪论 - 1 - 1.1 课题研究背景及意义 - 1 - 1.2 市场频率计厂商介绍 - 3 - 1.3 数字频率计设计的任务与要求 - 4 - 2 测频方法选择 - 5 - 2.1 测频方法设计的几种方案 - 5 - 2.2 几种方案的优劣讨论 - 6 - 2.3 本次设计采用的方案 - 6 - 3 数字频率计的硬件电路设计 - 7 - 3.1 数字频率计的硬件系统框架 - 7 - 3.2 单