CN101206235A - Method for measuring frequency of single-chip - Google Patents
Method for measuring frequency of single-chip Download PDFInfo
- Publication number
- CN101206235A CN101206235A CNA2006101478317A CN200610147831A CN101206235A CN 101206235 A CN101206235 A CN 101206235A CN A2006101478317 A CNA2006101478317 A CN A2006101478317A CN 200610147831 A CN200610147831 A CN 200610147831A CN 101206235 A CN101206235 A CN 101206235A
- Authority
- CN
- China
- Prior art keywords
- frequency
- measuring
- pulse
- counter
- 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.)
- Granted
Links
Images
Abstract
The invention discloses a method for measuring the frequency of a singlechip. The method can realize precise measurement of frequency and includes the two steps of initial setting and measurement, wherein, a time threshold T is set at first; the input realtime time t of pulse and the number N of input pulses are recorded within time m x T; finally, practical time threshold T is obtained through subtracting the input realtime time of a first pulse from that of the last pulse. Because the measurement error of the method comes from the error of clock frequency, the method has high measurement precision; moreover, the method is also suitable for low-frequency and high-frequency measurement.
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 counts, and count value adds 1, and this moment, the value of this counter became 0000 (sexadecimal) generation excessive place interruption, 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 the place of overflowing constantly again and interrupt, 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 interrupt at the place of overflowing 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. the method for a 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) generation excessive place 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 the place of overflowing so again and interrupts behind N pulse number of counter T0 counting, 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 interrupt at the place of overflowing 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 true CN101206235A (en) | 2008-06-25 |
CN100575965C 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) |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101893657A (en) * | 2009-05-22 | 2010-11-24 | 精工爱普生株式会社 | Frequency measuring equipment |
CN101968510A (en) * | 2010-09-21 | 2011-02-09 | 天津农学院 | High-resolution measuring circuit and method thereof for frequency of output signal of resonator sensor |
CN102128981A (en) * | 2010-12-29 | 2011-07-20 | 上海大学 | Method for measuring pulse signal period |
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 |
CN101871968B (en) * | 2009-04-24 | 2011-12-07 | 郑州威科姆科技股份有限公司 | Reliable time scale pulse measurement method and measurement device thereof |
CN102621384A (en) * | 2012-04-09 | 2012-08-01 | 浙江中控技术股份有限公司 | Frequency measuring method and frequency measuring system |
CN102749508A (en) * | 2011-04-20 | 2012-10-24 | 北京德威特继保自动化科技股份有限公司 | Frequency measurement device and method |
CN103529293A (en) * | 2013-09-11 | 2014-01-22 | 西安电子科技大学 | Method for measuring parallel frequency and periodic signal parameters based on edge effect |
CN103558454A (en) * | 2013-11-06 | 2014-02-05 | 台安科技(无锡)有限公司 | Measurement method for pulse input frequency |
CN103698602A (en) * | 2013-12-16 | 2014-04-02 | 北京自动化控制设备研究所 | Large dynamic high-precision synchronization continuous frequency measurement method |
CN104115403A (en) * | 2012-10-24 | 2014-10-22 | Abb技术有限公司 | Pulse frequency measurement device and method and control system |
CN104635045A (en) * | 2015-02-05 | 2015-05-20 | 广东电网有限责任公司电力科学研究院 | Power signal frequency detection method and system based on phase modulation |
CN104635044A (en) * | 2015-02-05 | 2015-05-20 | 广东电网有限责任公司电力科学研究院 | Power signal frequency detection method and system based on amplitude modulation |
CN104833848A (en) * | 2015-04-20 | 2015-08-12 | 深圳市海浦蒙特科技有限公司 | Method and system for measuring pulse frequency |
WO2017054559A1 (en) * | 2015-09-29 | 2017-04-06 | 中兴通讯股份有限公司 | Clock frequency recognition method and apparatus |
CN106569032A (en) * | 2016-10-17 | 2017-04-19 | 长沙开元仪器股份有限公司 | Signal frequency and duty ratio prediction method 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 |
CN108226756A (en) * | 2018-01-29 | 2018-06-29 | 深圳市兴威帆电子技术有限公司 | The test system and its test method of a kind 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
Cited By (27)
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 |
CN101893657A (en) * | 2009-05-22 | 2010-11-24 | 精工爱普生株式会社 | Frequency measuring equipment |
CN101968510A (en) * | 2010-09-21 | 2011-02-09 | 天津农学院 | High-resolution measuring circuit and method thereof for frequency of output signal of resonator sensor |
CN102128981A (en) * | 2010-12-29 | 2011-07-20 | 上海大学 | Method for measuring pulse signal period |
CN102749508B (en) * | 2011-04-20 | 2015-08-12 | 北京德威特继保自动化科技股份有限公司 | Frequency measuring equipment and method |
CN102749508A (en) * | 2011-04-20 | 2012-10-24 | 北京德威特继保自动化科技股份有限公司 | Frequency measurement device 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 |
CN102621384A (en) * | 2012-04-09 | 2012-08-01 | 浙江中控技术股份有限公司 | Frequency measuring method and frequency measuring system |
CN104115403B (en) * | 2012-10-24 | 2016-10-19 | Abb技术有限公司 | Pulse frequency measurement equipment and method and control system |
CN104115403A (en) * | 2012-10-24 | 2014-10-22 | Abb技术有限公司 | Pulse frequency measurement device and method and control system |
CN103529293A (en) * | 2013-09-11 | 2014-01-22 | 西安电子科技大学 | Method for measuring parallel frequency and periodic signal parameters based on edge effect |
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 |
CN103558454A (en) * | 2013-11-06 | 2014-02-05 | 台安科技(无锡)有限公司 | Measurement method for pulse input frequency |
CN103698602A (en) * | 2013-12-16 | 2014-04-02 | 北京自动化控制设备研究所 | Large dynamic high-precision synchronization continuous 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 |
CN104635044A (en) * | 2015-02-05 | 2015-05-20 | 广东电网有限责任公司电力科学研究院 | Power signal frequency detection method and system based on amplitude modulation |
CN104635045A (en) * | 2015-02-05 | 2015-05-20 | 广东电网有限责任公司电力科学研究院 | Power signal frequency detection method and system based on phase modulation |
CN104833848A (en) * | 2015-04-20 | 2015-08-12 | 深圳市海浦蒙特科技有限公司 | Method and system for measuring pulse frequency |
WO2017054559A1 (en) * | 2015-09-29 | 2017-04-06 | 中兴通讯股份有限公司 | Clock frequency recognition method and apparatus |
CN106569032A (en) * | 2016-10-17 | 2017-04-19 | 长沙开元仪器股份有限公司 | Signal frequency and duty ratio prediction method based on embedded microcontroller |
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 |
CN108226756A (en) * | 2018-01-29 | 2018-06-29 | 深圳市兴威帆电子技术有限公司 | The test system and its test method of a kind of clock chip |
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 |
Also Published As
Publication number | Publication date |
---|---|
CN100575965C (en) | 2009-12-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100575965C (en) | A kind of method of measuring frequency of single-chip | |
CN105549379A (en) | Synchronous measurement apparatus based on high precision time reference triggering and method thereof | |
CN102590784B (en) | Single-phase intelligent energy meter distributed correction method | |
CN103487649B (en) | Method and device capable of measuring both frequency of continuous waves and frequency of pulse modulation carrier waves | |
CN102128981B (en) | Method for measuring pulse signal period | |
CN101799526B (en) | Method for calibrating high-precision RTC circuit in GPS receiver and module thereof | |
CN102565673B (en) | Highly-reliable pulse counting test system based on FPGA (Field Programmable Gate Array) | |
CN202256483U (en) | GPS (Global Positioning System) second-based real-time self-adaptive evenly-spaced sampling synchronous data acquisition device | |
AU2006202661B2 (en) | High resolution time interval measurement apparatus and method | |
CN102928677A (en) | Nano pulse signal acquiring method | |
CN102998970B (en) | High-precision time hack synchronizing method based on CRIO platform | |
CN105301627B (en) | A kind of energy spectrum analysis method, energy spectrum analysis system and gamma-ray detection system | |
CN109407500B (en) | Time interval measuring method based on FPGA | |
CN105245203B (en) | High-precision low-speed clock duty ratio detecting system and method | |
CN103199870A (en) | Quick positioning device for trigger point | |
CN104849549A (en) | Method and system for measuring impulse frequency | |
CN101581596A (en) | Flow detecting method based on double-time measurement technology and apparatus thereof | |
CN200993665Y (en) | Small digitalized prase-comparing measuring device | |
CN201540331U (en) | Multi-passage high-precision synchronous frequency-measuring device | |
CN103135650A (en) | Current/frequency conversion circuit linearity and symmetry digital compensation method | |
CN209117877U (en) | A kind of multi-channel high-accuracy laser time of flight measuring system | |
CN101556325A (en) | Method for quickly verifying electric energy error | |
CN103558454B (en) | A kind of Puled input frequency measurement method | |
CN202393904U (en) | Error verifying device used for electric energy metering device | |
US20130346022A1 (en) | Physical quantity measuring apparatus and physical quantity measuring method |
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 |
Granted publication date: 20091230 Termination date: 20191222 |
|
CF01 | Termination of patent right due to non-payment of annual fee |