CN100575965C - A kind of method of measuring frequency of single-chip - Google Patents
A kind of method of measuring frequency of single-chip Download PDFInfo
- Publication number
- CN100575965C CN100575965C CN200610147831A CN200610147831A CN100575965C CN 100575965 C CN100575965 C CN 100575965C CN 200610147831 A CN200610147831 A CN 200610147831A CN 200610147831 A CN200610147831 A CN 200610147831A CN 100575965 C CN100575965 C CN 100575965C
- Authority
- CN
- China
- Prior art keywords
- frequency
- time
- measuring
- pulse
- chip
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000005259 measurement Methods 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 1
- JEIPFZHSYJVQDO-UHFFFAOYSA-N ferric oxide Chemical compound O=[Fe]O[Fe]=O JEIPFZHSYJVQDO-UHFFFAOYSA-N 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000005728 strengthening Methods 0.000 description 1
Images
Landscapes
- Measuring Frequencies, Analyzing Spectra (AREA)
Abstract
The present invention discloses a kind of method of measuring frequency of single-chip, and it is survey frequency accurately.This method comprises initial setting and finishes and measure two steps.Be specially a time threshold values T is set, in time m*T, write down the input real-time time t of pulse and the number N of input pulse.The real-time time that deducts first pulse input with last pulse input real-time time just obtains actual time threshold values T.The measuring error of this method is from the error of clock frequency, the measuring accuracy height, and be fit to the measurement of low frequency and high frequency simultaneously.
Description
Technical field
The present invention relates to a kind of method of measuring frequency of single-chip, relate in particular to the method for the accurate survey frequency of a kind of energy.
Background technology
Usually, single-chip microcomputer has following several method to the measurement of frequency:
(1) " f " frequency method
" f " method is regularly that accumulative total is by the method for the number of measured frequency.It needs time threshold values t, then in the t scope to tested frequency signal step-by-step counting.Error is proportional to 1/f*t, and f is a signal frequency.Base t in the time of can strengthening in order to reduce error, or improve signal frequency.Can be used for measuring high-frequency signal.
(2) " t " method
This method is to measure the method for measured pulse width.Measuring error is proportional to 1/f*t, and f is a clock frequency, and t is the signal period, therefore is used to measure low frequency signal.
(3) " mt " method
Be also referred to as the multiprecision periodic method.Be difference, select the method for different measured signal periodicities according to clock frequency.
(4) " m/t " method
The sampling timing of default is t
0, and regularly finish to the time interval in next pulse forward position be Δ t, then actual measurement time t is t
0With Δ t sum.Be recorded in the umber of pulse of the detection in the t time and the count value of interior system reference time clock of t time.As seen its error is from the counting error of time clock, the measuring accuracy height.
Summary of the invention
The object of the present invention is to provide a kind of method of measuring frequency of single-chip, it is survey frequency accurately.For reaching this purpose, the advantage of the comprehensive said method of the present invention adopts the f/t method, and this method comprises the initial setting stage and finishes measuring phases.Be specially a time threshold values T is set, in time m*T, write down the input real-time time t of pulse and the number N of input pulse.The real-time time that deducts first pulse input with last pulse input real-time time just obtains actual time threshold values T.Referring to the Reference numeral F among Fig. 2, and adopt during actual treatment accurate T in the time accurately pulse number (n-1) calculate pulsed frequency.
The error of measuring frequency of single-chip method provided by the invention is from the error of clock frequency, the measuring accuracy height, and be fit to the measurement of low frequency and high frequency simultaneously.
Description of drawings
Fig. 1 is the block diagram according to measuring frequency of single-chip method of the present invention;
Fig. 2 is the circuit diagram according to measuring frequency of single-chip method of the present invention;
Fig. 3 is the sequential chart according to measuring frequency of single-chip method of the present invention.
Embodiment
Below in conjunction with accompanying drawing, describe the method for measuring frequency of single-chip of the present invention in detail.Wherein Fig. 1 is the block diagram according to measuring frequency of single-chip method of the present invention, Fig. 2 is the circuit diagram according to measuring frequency of single-chip method of the present invention, the frequency signal of measuring enters the timer T0 of single-chip microcomputer by the high-speed photoelectric coupler with this schmitt trigger, and the high-speed photoelectric coupler of this schmitt trigger of select tape is in order to improve the antijamming capability that Single Chip Microcomputer (SCM) system is measured.Fig. 3 is the sequential chart according to measuring frequency of single-chip method of the present invention.The method of this measuring frequency of single-chip is as follows:
(1) initial setting step: the counter T0 among Fig. 1 initially is made as 16 digit counter modes, and initial value is FFFF (sexadecimal), and timer T1 initially is made as 16 bit timing device modes, and the time is T during initial setting.
(2) finish measuring process: at t
sThe negative edge of first pulse constantly, counter T0 counting, count value adds 1, and the value of this counter became 0000 (sexadecimal) and produced and overflow interruption this moment, write down this value t of timer T1 constantly in the T0 interrupt service routine
1The initial value that reinitializes counter T0 is (FFFF-N)+1, and wherein N is for needing the pulse number of measurement, like this behind N pulse number of counter T0 counting, at t
pProduce again constantly and overflow interruption, in the T0 interrupt service routine, write down this value t of timer T1 constantly
2According to formula: F=N/[m*T-(t
1-T)+(t
2-T)] and can calculate the frequency values that will measure pulse, wherein m is that timer T1 produces the number of times that overflows interruption every the T time.
The method hardware circuit of measuring frequency of single-chip provided by the invention is simple, do not need to increase cost, measuring error is from the error of clock frequency, and the error of clock frequency can be with the method correction that adds the standard frequency signal, promptly according to the step of above-mentioned (1)~(2), add a height respectively with the high precision frequency recorder, in, low-frequency signals is to the F end of input channel high-speed photoelectric coupler, respectively the error of measuring is saved in the Single Chip Microcomputer (SCM) system, later on the frequency signal that Single Chip Microcomputer (SCM) system is calculated measurement earlier during the actual measurement frequency signal drops on height, in, low which frequency band, the inner corresponding error correction of preserving of reusing system it, can improve measuring accuracy greatly.
In addition, the method for a kind of measuring frequency of single-chip provided by the invention is measured maximum demand and has been obtained good application in multiple rate time-sharing ammeter and IC-card table.
To one skilled in the art, the present invention can make various modification.As long as these modifications fall in additional claims scope, the present invention will cover these modifications.
Claims (2)
1, a kind of method of measuring frequency of single-chip is characterized in that, comprising:
(1) initial setting step: counter T0 initially is made as 16 digit counter modes, and initial value is FFFF, and timer T1 is 16 bit timing device modes;
(2) finish measuring process: at the negative edge of first pulse, counter T0 counting, count value adds 1 and becomes 0000 (sexadecimal) and produce and overflow interruption, writes down this value t of T1 timer constantly in the T0 interrupt service routine
1, reinitialize counter T0 initial value and be (FFFF-N)+1, wherein the pulse number of N for needing to measure produces again behind N pulse number of counter T0 counting like this and overflows interruption, writes down this value t of timer T1 constantly in the T0 interrupt service routine
2, according to formula: F=N/[m*T-(t
1-T)+(t
2-T)] and calculate the frequency values that will measure pulse, wherein m is that timer T1 produces the number of times that overflows interruption every the T time.
2, the method for measuring frequency of single-chip as claimed in claim 1 is characterized in that in the above-mentioned measuring error that produces in the measuring process finished from clocking error, and the error of this clock frequency can be with the method correction that adds the standard frequency signal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200610147831A CN100575965C (en) | 2006-12-22 | 2006-12-22 | A kind of method of measuring frequency of single-chip |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200610147831A CN100575965C (en) | 2006-12-22 | 2006-12-22 | A kind of method of measuring frequency of single-chip |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101206235A CN101206235A (en) | 2008-06-25 |
CN100575965C true CN100575965C (en) | 2009-12-30 |
Family
ID=39566594
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200610147831A Expired - Fee Related CN100575965C (en) | 2006-12-22 | 2006-12-22 | A kind of method of measuring frequency of single-chip |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100575965C (en) |
Families Citing this family (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101871968B (en) * | 2009-04-24 | 2011-12-07 | 郑州威科姆科技股份有限公司 | Reliable time scale pulse measurement method and measurement device thereof |
JP5440999B2 (en) * | 2009-05-22 | 2014-03-12 | セイコーエプソン株式会社 | Frequency measuring device |
CN101968510B (en) * | 2010-09-21 | 2013-04-17 | 天津农学院 | High-resolution measuring circuit and method thereof for frequency of output signal of resonator sensor |
CN102128981B (en) * | 2010-12-29 | 2012-11-07 | 上海大学 | Pulse Signal Period Measurement Method |
CN102749508B (en) * | 2011-04-20 | 2015-08-12 | 北京德威特继保自动化科技股份有限公司 | Frequency measuring equipment and method |
CN102253281A (en) * | 2011-04-26 | 2011-11-23 | 江苏斯菲尔电气股份有限公司 | Method for measuring power grid frequency by resisting harmonic interference and automatically changing phase based on software |
CN102621384B (en) * | 2012-04-09 | 2014-09-10 | 浙江中控技术股份有限公司 | Frequency measuring method and frequency measuring system |
EP2912773B1 (en) * | 2012-10-24 | 2019-12-04 | ABB Schweiz AG | Pulse frequency measurement device and method and control system |
CN103529293B (en) * | 2013-09-11 | 2015-09-30 | 西安电子科技大学 | Based on parallel frequency and the cyclical signal measurement method of parameters of rim effect |
CN103558454B (en) * | 2013-11-06 | 2016-01-20 | 台安科技(无锡)有限公司 | A kind of Puled input frequency measurement method |
CN103698602B (en) * | 2013-12-16 | 2016-05-18 | 北京自动化控制设备研究所 | A kind of large synchronous cline frequency measuring method of dynamic high precision |
CN104635044B (en) * | 2015-02-05 | 2017-05-24 | 广东电网有限责任公司电力科学研究院 | Power signal frequency detection method and system based on amplitude modulation |
CN104635045B (en) * | 2015-02-05 | 2017-09-26 | 广东电网有限责任公司电力科学研究院 | Frequency power signal detection method and system based on phase-modulation |
CN104833848B (en) * | 2015-04-20 | 2018-05-04 | 深圳市海浦蒙特科技有限公司 | Measure the method and system of pulse frequency |
CN106559156A (en) * | 2015-09-29 | 2017-04-05 | 中兴通讯股份有限公司 | The method and apparatus of clock frequency identification |
CN106569032B (en) * | 2016-10-17 | 2019-05-31 | 长沙开元仪器股份有限公司 | A kind of detection method of signal frequency and duty ratio based on embedded microcontroller |
CN107064631A (en) * | 2017-03-21 | 2017-08-18 | 昆明理工大学 | A kind of SCM Based high-precision frequency meter realizes circuit and method |
CN108226756B (en) * | 2018-01-29 | 2020-06-02 | 深圳市兴威帆电子技术有限公司 | Test system and test method of clock chip |
CN111175573A (en) * | 2020-02-14 | 2020-05-19 | 深圳市科信通信技术股份有限公司 | Method, device, equipment and medium for detecting alternating voltage frequency |
-
2006
- 2006-12-22 CN CN200610147831A patent/CN100575965C/en not_active Expired - Fee Related
Non-Patent Citations (4)
Title |
---|
基于单片机高精度测频方法的研究. 王淑青,吴作健.湖北工业大学学报,第20卷第4期. 2005 |
基于单片机高精度测频方法的研究. 王淑青,吴作健.湖北工业大学学报,第20卷第4期. 2005 * |
频率快速测量法. 宋继明,黎江,沈丹.电测与仪表. 1995 |
频率快速测量法. 宋继明,黎江,沈丹.电测与仪表. 1995 * |
Also Published As
Publication number | Publication date |
---|---|
CN101206235A (en) | 2008-06-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100575965C (en) | A kind of method of measuring frequency of single-chip | |
CN101893464B (en) | High-precision and fast pulse metering method | |
CN105549379A (en) | Synchronous measurement apparatus based on high precision time reference triggering and method thereof | |
CN103487649B (en) | Method and device capable of measuring both frequency of continuous waves and frequency of pulse modulation carrier waves | |
CN100501421C (en) | Fast frequency measuring system and method | |
CN102928677A (en) | Nano pulse signal acquiring method | |
CN102565673B (en) | Highly-reliable pulse counting test system based on FPGA (Field Programmable Gate Array) | |
CN106385256A (en) | Multi-channel parallel acquisition system with storage function and synchronous recognition function | |
CN104849549B (en) | Measure the method and system of pulse frequency | |
CN101976037A (en) | Method and device for measuring time intervals of repeated synchronous interpolation simulation | |
CN104407510B (en) | A kind of method and apparatus of time service | |
CN105245203B (en) | High-precision low-speed clock duty ratio detecting system and method | |
CN105301627A (en) | Power spectrum analysis method, power spectrum analysis system and Gamma ray detection system | |
CN200993665Y (en) | Small digitalized prase-comparing measuring device | |
CN201540331U (en) | Multi-passage high-precision synchronous frequency-measuring device | |
CN101556325A (en) | Method for quickly verifying electric energy error | |
CN103135650A (en) | Current/frequency conversion circuit linearity and symmetry digital compensation method | |
CN110187237A (en) | Real-time detection and the synchronized acquisition method and its device for adjusting crystal oscillator output frequency | |
CN110908272B (en) | 1pps pulse signal timing method | |
CN104316775A (en) | Pulse signal cycle and duty ratio continuous measurement method | |
CN105866542A (en) | High-accuracy sliding frequency measurement method | |
CN103558454B (en) | A kind of Puled input frequency measurement method | |
CN114355360B (en) | Echo frequency estimation method of Doppler log | |
CN203837783U (en) | Detected pulse collection and comparison board based on FPGA | |
CN222232580U (en) | An ultra-high precision frequency and pulse number measurement device based on FPGA |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20091230 Termination date: 20191222 |