CN106569032A - Signal frequency and duty ratio prediction method based on embedded microcontroller - Google Patents

Signal frequency and duty ratio prediction method based on embedded microcontroller Download PDF

Info

Publication number
CN106569032A
CN106569032A CN201610905453.8A CN201610905453A CN106569032A CN 106569032 A CN106569032 A CN 106569032A CN 201610905453 A CN201610905453 A CN 201610905453A CN 106569032 A CN106569032 A CN 106569032A
Authority
CN
China
Prior art keywords
pulse signal
frequency
signal
measured pulse
timer
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
Application number
CN201610905453.8A
Other languages
Chinese (zh)
Other versions
CN106569032B (en
Inventor
罗建文
潘健
肖幸
廖炼斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changsha Kaiyuan Instruments Co Ltd
Original Assignee
Changsha Kaiyuan Instruments Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Changsha Kaiyuan Instruments Co Ltd filed Critical Changsha Kaiyuan Instruments Co Ltd
Priority to CN201610905453.8A priority Critical patent/CN106569032B/en
Publication of CN106569032A publication Critical patent/CN106569032A/en
Application granted granted Critical
Publication of CN106569032B publication Critical patent/CN106569032B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R23/00Arrangements for measuring frequencies; Arrangements for analysing frequency spectra
    • G01R23/02Arrangements for measuring frequency, e.g. pulse repetition rate; Arrangements for measuring period of current or voltage
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R29/00Arrangements for measuring or indicating electric quantities not covered by groups G01R19/00 - G01R27/00
    • G01R29/02Measuring characteristics of individual pulses, e.g. deviation from pulse flatness, rise time or duration

Abstract

The invention provides a signal frequency and duty ratio prediction method based on an embedded microcontroller, and the method comprises the steps: determining a measurement period of a signal according to the demands of an embedded system; capturing the characteristic values of arrival time of the adjacent rising edges of a detected pulse signal and the characteristic values of arrival time of the falling edges in the same period through employing the capturing interruption enabling and timing interruption enabling of a timer of a central processing unit; comparing the characteristic values of the adjacent rising edges, and obtaining a frequency value of the detected pulse signal; comparing the characteristic values of arrival time of the rising edges and the falling edges, and calculating the duty ratio of the detected pulse signal, wherein the captured characteristic values can be used for making a judgment and controlling one frequency measurement process to be carried out in one frequency measurement period. The method greatly extends the frequency range of the detected pulse signal of the embedded microcontroller, simplifies the frequency measurement mode of the detected pulse signal changing in a wider frequency range, reduces the CPU usage rate of the system, and also can measure the duty ratios of detected pulse signals.

Description

A kind of detection method of the signal frequency and dutycycle based on embedded microcontroller
Technical field
The present invention relates to the frequency detecting technology of micro- electric impulse signal, more particularly, to based on embedded microcontroller Signal frequency detection method.
Background technology
In automatization, today of intelligent deeply development, many signals are related to the measurement of digital waveform, including frequency with account for Sky ratio.It is a kind of most popular mode to measure the frequency of square wave and dutycycle using embedded microcontroller.Due to signal Frequency from high to low, scope is extremely wide, and at present, general mode is that high-frequency signal is measured using the mode for counting, and Low frequency signal is measured using the mode of timing, and according to practical situation measuring method is preset.
During measurement low frequency signal, the rising signals of signal are counted using timer clock, calculate one week of waveform The quantity of the timer count signal in the phase, it is known that the frequency of intervalometer, you can calculate the cycle T of signal, so as to obtain frequency Rate value.
When low frequency signal uses chronometry measurement frequency, the general mode with Interruption, if now there is high-frequency signal to connect Enter, interruption occupies substantial amounts of CPU run time, and system may cannot be jumped out in the interruption of long period, given The stability of system brings more risk.
During measurement high-frequency signal, several waveforms of continuous counter, then calculate several ripples by the way of counting The time that shape spends altogether, then the cycle of a complete waveform is calculated, so as to draw frequency.But counting procedure typically compares Complexity, and the quantity for counting is difficult determination.Because the scope of high-frequency signal it is wider, the highest threshold values and minimum valve of actual measurement Time of measuring between value is widely different.For example, it is assumed that signal is 1KHz~8KHz, counting is assumed to be 100, then measure 8KHz The response time needed during signal is 1.25ms, and the response time of 1KHz signal demands is 10ms.Therefore, on stream The quantity for needing micro-judgment to count.
And the mode using counting method measures high-frequency signal, if high frequency shelves have low frequency signal to access such as 20Hz, need 5S could count full 100 pulses, and the time of response is very long.
Different measuring methods are selected according to the different frequency range of signal, this kind of mode is easy to use, it is reliable convenient, but In the case of unknown object frequency range, there is certain limitation.Under normal circumstances, default high frequency must with the threshold values of low frequency Must overlap, when measured signal is near threshold signal, easily produce the mistake of counting method and chronometry switching, and bad boundary Determine critical frequency.The misconnection or when having more than the signal of measurement range in port, CPU may lose response or Person is collapsed, and affects the stability of system.Additionally, both approaches are unable to measurement signal dutycycle.
The content of the invention
The present invention provide it is a kind of overcome the problems referred to above or solve the above problems at least in part based on embedded micro-control The signal frequency detection method of device processed.
According to an aspect of the present invention, there is provided a kind of letter based on embedded microcontroller for adapting to wider frequency range The detection method of number frequency, it is received by CPU and is processed measured pulse signal, and according to the need of embedded system The measure the cycle for determining signal is sought, within a frequency measurement cycle, its specific measuring process is as follows:
Enable is interrupted in S1, the Interruption enable for arranging central processing element timer and capture;
S2, when measured pulse signal a complete waveform first rising edge arrive when, timer capture interrupt make Can, external interrupt is triggered, CPU obtains and records the First Eigenvalue of measured pulse signal;
S3, when measured pulse signal a complete waveform second rising edge arrive when, timer capture interrupt make Can, external interrupt is triggered, the system timer of CPU records the Second Eigenvalue of measured pulse signal;
S4, confirmation complete an impulsive measurement process;
Close capture and interrupt and enable, the Second Eigenvalue and the First Eigenvalue are compared into computing, calculate by Survey the frequency values of pulse signal.
Within a frequency measurement cycle, by the cycle of one complete waveform of direct measurement, and control only carries out one Frequency measuring process, while extension frequency measurement range, simplifies the pulse signal of occurrence frequency change in relative broad range Frequency measurement mode.
According to another aspect of the present invention, the application proposes a kind of while signal of the detection based on embedded microcontroller The detection method of frequency and dutycycle, it is received by CPU and is processed measured pulse signal, and according to embedded system The demand of system determines the measure the cycle of signal, and within a frequency measurement cycle, its specific measuring process is as follows:
Enable is interrupted in SS1, the Interruption enable for arranging central processing element timer and capture;
SS2, when measured pulse signal a complete waveform first rising edge arrive when, timer capture interrupt make Can, external interrupt is triggered, obtained by CPU and recorded the third feature value of measured pulse signal;
SS3, when measured pulse signal a complete waveform first trailing edge arrive when, timer capture interrupt make Can, external interrupt is triggered, the fourth feature value of measured pulse signal is recorded by the system timer of CPU;
SS4, when measured pulse signal a complete waveform second rising edge arrive when, timer capture interrupt make Can, external interrupt is triggered, the fifth feature value of measured pulse signal is recorded by the system timer of CPU;
SS5, confirmation complete an impulsive measurement process;
Close capture and interrupt and enable, the fourth feature value and third feature value are compared into computing, calculate by Survey the dutyfactor value of pulse signal;
The fifth feature value and third feature value are compared into computing, the frequency of measured pulse signal is calculated Value.
Within a frequency measurement cycle, by the cycle of one complete waveform of direct measurement, and control only carries out one Frequency measuring process, while extension frequency measurement range, can also simultaneously measure the dutycycle of measured pulse signal.
The application provide based on embedded microcontroller signal frequency and the detection method of dutycycle, its advantage is such as Under:
(1) by predeterminated frequency measure the cycle, and using the timestamp of system beat timing, direct measurement measured pulse letter The cycle of a number complete waveform and be calculated the frequency of signal, greatly expand the frequency range of measurement signal, also, institute It is related to control program simple;
(2) when measuring high-frequency signal, it is to avoid using complicated counting method control program, and adjust repeatedly by rule of thumb high The trouble of frequency signal-count value;
(3) low frequency signal and high-frequency signal are measured, using identical metering system, without the need in different measuring mode or difference Switch between port;
(4) avoid low-speed port misconnection high-speed port from causing the risk of system in case of system halt, it also avoid high-speed port misconnection low Response speed becomes the problem extremely grown during fast port;
(5) by predeterminated frequency measure the cycle, the measurement process of a secondary frequencies is only carried out within a frequency measurement cycle;
(6) state when by recording or arranging rising edge or trailing edge arrival, judges that measured pulse signal one is complete The completion statuses or the completion statuses in a frequency measurement cycle of wave period measurement;
(7) while measurement signal frequency, can be with the dutycycle of measurement signal.
Description of the drawings
Fig. 1 is the structural representation in the embodiment of the present invention;
Fig. 2 is the structural representation in the embodiment of the present invention.
Specific embodiment
With reference to the accompanying drawings and examples, the specific embodiment of the present invention is described in further detail.Hereinafter implement Example is not limited to the scope of the present invention for illustrating the present invention.
Shown in Figure 1, a kind of signal frequency detection method based on embedded microcontroller is connect by CPU Measured pulse signal, and the default measure the cycle that signal is determined according to the demand of embedded system are received and process, in a frequency In measure the cycle, specific measurement process is comprised the following steps:
Enable is interrupted in S1, the Interruption enable for arranging central processing element timer and capture;
S2, when measured pulse signal a complete waveform first rising edge arrive when, timer capture interrupt make Can, external interrupt is triggered, CPU obtains and records the First Eigenvalue of measured pulse signal;
S3, when measured pulse signal a complete waveform second rising edge arrive when, timer capture interrupt make Can, external interrupt is triggered, the system timer of CPU records the Second Eigenvalue of measured pulse signal;
S4, confirmation complete an impulsive measurement process;
Close capture and interrupt and enable, the Second Eigenvalue and the First Eigenvalue are compared into computing, calculate by Survey the frequency values of pulse signal.
When starting to measure the frequency of measured pulse signal, enable is interrupted in the capture for arranging CPU, And after the frequency measurement for completing a complete waveform, close capture and interrupt enable, make only to enter within a frequency measurement cycle One frequency measuring process of row.Effectively avoid when carrying out frequency measurement using timing or counting mode, due to high frequency and low The change of frequency signal is changed and causes the phenomenon of system in case of system halt or response time overlength.Both measurement measured pulse signal frequency is reached Purpose, meanwhile, the computational burden of CPU is significantly reduced again, improve CPU computing effect Rate.
Additionally, in measurement frequency, being realized by the direct measurement of a complete waveform to measured pulse signal , therefore, in measurement process, when the frequency of measured pulse signal is widely varied, and need not accordingly convert survey Amount method, so as to greatly expand the frequency range of measured pulse signal.Pulse of the frequency range in 1Hz~1MHz is believed Number, without the need for changing any metering system, you can directly measure.
" the First Eigenvalue " in above-mentioned steps S2 is upper for timer value 1, the timestamp 1 of system beat timing and waveform Rise mark 1.
" Second Eigenvalue " in above-mentioned steps S3 is the timestamp 2 of timer value 2 and system beat timing.
When the rising edge of measured pulse signal is reached, timer capture interrupts enable, triggers external interrupt, now, together When recording timer value, the timestamp of system beat timing and rise mark, and capture in the comparand register of matching.
Seizure and record to three kinds of eigenvalues, can more accurately determine measured pulse signal rising edge reach when Carve, meanwhile, also allow for the judgement of the completion statuses to an impulsive measurement and the completion statuses in a frequency measurement cycle.
Concretely comprising the following steps to the confirmation of a frequency measurement cycle completion statuses in above-mentioned steps S4:
S41, when measured pulse signal a complete waveform first rising edge arrive when, be recorded as rise mark 1;
S42, when measured pulse signal a complete waveform second rising edge arrive when, CPU judge Rising identified whether as 1, if 1, judge that an impulsive measurement process has been completed, and the rising for arranging now is designated 2, enters Row comparison operation;
S43, when the value of intervalometer rises to the system beat cycle, the Interruption of intervalometer is enabled, and triggers system Interrupt, the value of intervalometer is cleared, and judge the rising mark that CPU is recorded, if 1, into step S42;If 2, judge that an impulsive measurement process is over, mark will be risen and be set to 0, wait and enter the next frequency measurement cycle, after Continuous step S1.
By judging the state for rising mark, a completed wave of measured pulse signal both can have accurately been caught Shape, accurately to measure the frequency of the pulse signal, it is also possible to for judging the completion statuses of an impulsive measurement process, make one A frequency measuring process is only carried out in the individual frequency measurement cycle.
Meanwhile, when the value of intervalometer rises to the system beat cycle, the value of intervalometer will be cleared, and can remove in time The record of redundant data, saves the memory space of CPU.
The comparison calculation of above-mentioned steps medium frequency value is:
Calculate difference a of timer value 2 and timer value 1;
Difference b of the timestamp 2 of computing system beat timing and the timestamp 1 of system beat timing;
According to difference a and difference b and, you can draw the cycle of measured pulse signal, and then be calculated measured pulse The frequency values of signal.
In another embodiment, it is shown in Figure 2, there is provided a kind of signal frequency based on embedded microcontroller and to account for The detection method of empty ratio, it is received by CPU and is processed measured pulse signal, and according to the demand of embedded system Determine the measure the cycle of signal, within a frequency measurement cycle, its specific measuring process is as follows:
Enable is interrupted in SS1, the Interruption enable for arranging central processing element timer and capture;
SS2, when measured pulse signal a complete waveform first rising edge arrive when, timer capture interrupt make Can, external interrupt is triggered, obtained by CPU and recorded the third feature value of measured pulse signal;
SS3, when measured pulse signal a complete waveform first trailing edge arrive when, timer capture interrupt make Can, external interrupt is triggered, the fourth feature value of measured pulse signal is recorded by the system timer of CPU;
SS4, when measured pulse signal a complete waveform second rising edge arrive when, timer capture interrupt make Can, external interrupt is triggered, the fifth feature value of measured pulse signal is recorded by the system timer of CPU;
SS5, confirmation complete an impulsive measurement process;
Close capture and interrupt and enable, the fifth feature value and third feature value are compared into computing, calculate by Survey the frequency values of pulse signal;
The fourth feature value and third feature value are compared into computing, the dutycycle of measured pulse signal is calculated Value.
By the seizure at moment and state to rising edge and trailing edge arrival, measured pulse signal can be simultaneously obtained Pulse width and cycle.
When starting to measure the frequency of measured pulse signal, enable is interrupted in the capture for arranging CPU, And after the frequency measurement for completing a complete waveform, close capture and interrupt enable, make only to enter within a frequency measurement cycle One frequency measuring process of row.Effectively avoid when carrying out frequency measurement using timing or counting mode, due to high frequency and low The change of frequency signal is changed and causes the phenomenon of system in case of system halt or response time overlength.Both measurement measured pulse signal frequency is reached Purpose, meanwhile, the computational burden of CPU is significantly reduced again, improve CPU computing effect Rate.
Additionally, in measurement frequency, being realized by the direct measurement of a complete waveform to measured pulse signal , therefore, in measurement process, when the frequency of measured pulse signal is widely varied, and need not accordingly convert survey Amount method, so as to greatly expand the frequency range of measured pulse signal.It is in the intervalometer running frequency of flush bonding processor In the case of 100MHz, to frequency range 1Hz~1MHz pulse signal, without the need for changing any metering system, you can Directly measure.The precision of frequency measurement is within 2% in the case of the most limit.If the intervalometer fortune of flush bonding processor Line frequency faster, can measure broader scope.
" third feature value " in above-mentioned steps SS2 is timer value 3, the timestamp 3 of system beat timing and waveform Rise mark 1.
" fourth feature value " in above-mentioned steps SS3 is timer value 4, the timestamp 4 of system beat timing and waveform Decline mark 1.
" fifth feature value " in above-mentioned steps SS4 is the timestamp 5 of timer value 5 and system beat timing.
When the rising edge or trailing edge of measured pulse signal are reached, timer capture interrupts enable, triggers external interrupt, Now, while recording timer value, the timestamp of system beat timing and rising or falling mark, can more accurately determine The moment that measured pulse signal rising edge or trailing edge are reached, meanwhile, also allow for completion statuses and frequency to an impulsive measurement The judgement of the completion statuses of rate measure the cycle.
Concretely comprising the following steps to the confirmation of a frequency measurement cycle completion statuses in above-mentioned steps SS5:
SS51, when measured pulse signal a complete waveform first rising edge arrive when, be recorded as rise mark 1;
SS52, when measured pulse signal a complete waveform first trailing edge arrive when, be recorded as decline mark 1;
SS53, when measured pulse signal a complete waveform second rising edge arrive when, CPU is sentenced The disconnected mark or decline of rising identified whether as 1, if 1, judge that an impulsive measurement process has been completed, and arrange now it is upper Rise and be designated 2, be compared computing;
SS54, when the value of intervalometer rises to the system beat cycle, it is into system break, the value of intervalometer is clear Zero, and judge the rising mark that CPU is recorded, if 1, into step SS53;If 2, judge an impulsive measurement Process is over, and will rise mark and is set to 0, waits the measure the cycle for entering next frequency and dutycycle, return to step SS1。
Judged by the state to rising or falling mark, both can accurately catch the pulse of measured pulse signal Width and a complete waveform, with the frequency for accurately measuring the now pulse signal, it is also possible to for judging an impulsive measurement The completion statuses of process.
Meanwhile, when the value of intervalometer rises to the system beat cycle, the value of intervalometer will be cleared, and can remove in time The record of redundant data, saves the memory space of CPU.
The comparison operation mode of above-mentioned steps medium frequency value is:
Calculate difference c of timer value 5 and timer value 3;
Difference d of the timestamp 5 of computing system beat timing and the timestamp 3 of system beat timing;
According to difference c and difference d and, you can draw the cycle A of measured pulse signal, and then be calculated measured pulse The frequency values B of signal.
The comparison operation mode of dutyfactor value is in above-mentioned steps:
Calculate the difference e of timer value 4 and timer value 3;
Difference f of the timestamp 4 of computing system beat timing and the timestamp 3 of system beat timing;
By difference e and the sum of difference f, pulse width C of measured pulse signal is obtained;
By pulse width C and cycle A, the dutyfactor value of measured pulse signal is calculated.
The detection method of the signal frequency based on embedded microcontroller that the application is provided, according to the need of embedded system The measure the cycle for determining signal is sought, while interrupt using the capture of intervalometer enabling and Interruption enable, measured pulse is caught The eigenvalue when adjacent rising edges of signal are reached, and the eigenvalue of adjacent rising edges is compared into computing, obtain tested arteries and veins Rush the frequency values of signal.
Also, the eigenvalue that captures of application, the completion statuses of determination frequency measurement and frequency measurement cycle complete shape State, so as to control within a frequency measurement cycle, to complete a frequency measuring process, with regard to no longer carrying out frequency measurement, until Into the next frequency measurement cycle.
The signal frequency based on embedded microcontroller and the detection method of dutycycle that the application is provided, according to embedded The demand of system determines the measure the cycle of signal, while interrupt using the capture of intervalometer enabling and Interruption enable, catches The eigenvalue when adjacent rising edges of measured pulse signal are reached and the eigenvalue in the same cycle during trailing edge arrival, and The eigenvalue of adjacent rising edges is compared into computing, the frequency values of measured pulse signal are obtained, trailing edge is arrived with rising edge Up to when eigenvalue be compared, so as to be calculated the dutycycle of measured pulse signal.
Also, the eigenvalue that captures of application, the completion statuses of determination frequency measurement and frequency measurement cycle complete shape State, so as to control within a frequency measurement cycle, to complete a frequency measuring process, with regard to no longer carrying out frequency measurement, until Into the next frequency measurement cycle.
Finally, the present processes are only preferably embodiment, are not intended to limit protection scope of the present invention.It is all Within the spirit and principles in the present invention, any modification, equivalent substitution and improvements made etc. should be included in the protection of the present invention Within the scope of.

Claims (10)

1. a kind of signal frequency detection method based on embedded microcontroller, it is characterised in that received by CPU And measured pulse signal is processed, and the measure the cycle of signal is determined according to the demand of embedded system, a frequency measurement week In phase, its specific measuring process is as follows:
Enable is interrupted in S1, the Interruption enable for arranging central processing element timer and capture;
S2, when measured pulse signal a complete waveform first rising edge arrive when, timer capture interrupt enable, touch External interrupt is sent out, CPU obtains and record the First Eigenvalue of measured pulse signal;
S3, when measured pulse signal a complete waveform second rising edge arrive when, timer capture interrupt enable, touch External interrupt is sent out, the system timer of CPU records the Second Eigenvalue of measured pulse signal;
S4, confirmation complete an impulsive measurement process;
Close capture and interrupt enable, the Second Eigenvalue and the First Eigenvalue are compared into computing, calculate tested arteries and veins Rush the frequency values of signal.
2. a kind of signal frequency detection method based on embedded microcontroller as claimed in claim 1, it is characterised in that:Step S2 Described in " the First Eigenvalue " for timer value 1, the timestamp 1 of system beat timing and waveform rising mark 1.
3. a kind of signal frequency detection method based on embedded microcontroller as claimed in claim 1, it is characterised in that:Institute in S3 " Second Eigenvalue " stated is the timestamp 2 of timer value 2 and system beat timing.
4. a kind of signal frequency detection method based on embedded microcontroller as claimed in claim 1, it is characterised in that:Step S4 In " confirmation " concretely comprise the following steps:
S41, when measured pulse signal a complete waveform first rising edge arrive when, be recorded as rise mark 1;
S42, when measured pulse signal a complete waveform second rising edge arrive when, CPU judge rise Identify whether as 1, if 1, judge that an impulsive measurement process has been completed, and the rising for arranging now is designated 2, is compared Compared with computing;
S43, when the value of intervalometer rises to the system beat cycle, into system break, the value of intervalometer is reset, and sentence The rising mark of disconnected CPU record,
If 1, into step S42;
If 2, judge that an impulsive measurement process is over, mark will be risen and be set to 0, wait and enter next frequency measurement Cycle, return to step S1.
5. a kind of detection method of the signal frequency and dutycycle based on embedded microcontroller, is received simultaneously by CPU Measured pulse signal is processed, and the measure the cycle of signal is determined according to the demand of embedded system, a frequency measurement cycle Interior, its specific measuring process is as follows:
Enable is interrupted in SS1, the Interruption enable for arranging central processing element timer and capture;
SS2, when measured pulse signal a complete waveform first rising edge arrive when, timer capture interrupt enable, Triggering external interrupt, is obtained by CPU and is recorded the third feature value of measured pulse signal;
SS3, when measured pulse signal a complete waveform first trailing edge arrive when, timer capture interrupt enable, Triggering external interrupt, by the system timer of CPU the fourth feature value of measured pulse signal is recorded;
SS4, when measured pulse signal a complete waveform second rising edge arrive when, timer capture interrupt enable, Triggering external interrupt, by the system timer of CPU the fifth feature value of measured pulse signal is recorded;
SS5, confirmation complete an impulsive measurement process;
Close capture and interrupt enable, the fifth feature value and third feature value are compared into computing, calculate tested arteries and veins Rush the frequency values of signal;
The fourth feature value and third feature value are compared into computing, the dutyfactor value of measured pulse signal is calculated.
6. a kind of detection method of the signal frequency and dutycycle based on embedded microcontroller as claimed in claim 5, its feature It is:" third feature value " in step SS2 is timer value 3, the timestamp 3 of system beat timing and rises mark 1.
7. a kind of detection method of the signal frequency and dutycycle based on embedded microcontroller as claimed in claim 5, its feature It is:" fourth feature value " in step SS3 is timer value 4, the timestamp 4 of system beat timing and declines mark 1.
8. a kind of detection method of the signal frequency and dutycycle based on embedded microcontroller as claimed in claim 5, its feature It is:" fifth feature value " in step SS4 is the timestamp 5 of timer value 5 and system beat timing.
9. a kind of detection method of the signal frequency and dutycycle based on embedded microcontroller as claimed in claim 5, its feature It is that " confirmation " comprises the following steps that in step SS5:
SS51, when measured pulse signal a complete waveform first rising edge arrive when, be recorded as rise mark 1;
SS52, when measured pulse signal a complete waveform first trailing edge arrive when, be recorded as decline mark 1;
SS53, when measured pulse signal a complete waveform second rising edge arrive when, CPU judge on Rise mark or decline and identify whether as 1, if 1, judge that an impulsive measurement process has been completed, and the upper raising of indices now is set Know for 2, be compared computing;
SS54, when the value of intervalometer rises to the system beat cycle, into system break, the value of intervalometer is reset, and Judge the rising mark that CPU is recorded,
If 1, into step SS53;
If 2, judge that an impulsive measurement process is over, mark will be risen and be set to 0, wait and enter next frequency and account for Sky is than measure the cycle, return to step SS1.
10. a kind of signal frequency detection method based on embedded microcontroller as claimed in claim 5, it is characterised in that:It is described Intervalometer is the phaselocked loop voltage or other systems intervalometer of CPU.
CN201610905453.8A 2016-10-17 2016-10-17 A kind of detection method of signal frequency and duty ratio based on embedded microcontroller Active CN106569032B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610905453.8A CN106569032B (en) 2016-10-17 2016-10-17 A kind of detection method of signal frequency and duty ratio based on embedded microcontroller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610905453.8A CN106569032B (en) 2016-10-17 2016-10-17 A kind of detection method of signal frequency and duty ratio based on embedded microcontroller

Publications (2)

Publication Number Publication Date
CN106569032A true CN106569032A (en) 2017-04-19
CN106569032B CN106569032B (en) 2019-05-31

Family

ID=58533071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610905453.8A Active CN106569032B (en) 2016-10-17 2016-10-17 A kind of detection method of signal frequency and duty ratio based on embedded microcontroller

Country Status (1)

Country Link
CN (1) CN106569032B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108761201A (en) * 2018-04-04 2018-11-06 何晓龙 bit stream frequency measuring device and method
CN109361500A (en) * 2018-10-25 2019-02-19 南通先进通信技术研究院有限公司 A method of the plesiochronous external pulse of self-correcting based on chip
CN111948579A (en) * 2019-04-29 2020-11-17 深圳市优必选科技有限公司 Detection method and detection system for terminal connecting wire
CN112242828A (en) * 2020-09-11 2021-01-19 深圳市杉川机器人有限公司 Method, device and equipment for capturing pulse width modulation signal
CN113300902A (en) * 2021-03-29 2021-08-24 明峰医疗系统股份有限公司 Multichannel pulse width measurement and data transmission processing method
CN113630108A (en) * 2021-09-18 2021-11-09 温州大学 Triangular wave signal parameter measurement circuit
CN113823245A (en) * 2021-09-08 2021-12-21 富奥汽车零部件股份有限公司 Display screen brightness control method, control device and readable storage medium
CN114113802A (en) * 2020-08-31 2022-03-01 长鑫存储技术(上海)有限公司 Test circuit, test device and test method thereof
CN116057811A (en) * 2020-08-18 2023-05-02 微芯片技术股份有限公司 Frequency shift keying demodulation of wireless power transfer and related systems, methods, and devices
CN117111537A (en) * 2023-10-23 2023-11-24 北京科泰克科技有限责任公司 Control system and method for hydrogen system based on hydrogen controller

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05312975A (en) * 1992-05-07 1993-11-26 Matsushita Electric Ind Co Ltd Frequency discriminator
CN101206235A (en) * 2006-12-22 2008-06-25 上海贝岭股份有限公司 Method for measuring frequency of single-chip
CN102841247A (en) * 2012-08-30 2012-12-26 惠州三华工业有限公司 Detection method for grid frequency
CN102901870A (en) * 2012-08-30 2013-01-30 河南科技大学 Frequency testing system based on singlechip and testing method using same
CN202886465U (en) * 2012-08-30 2013-04-17 河南科技大学 Frequency test system based on single-chip microcomputer
CN104316775A (en) * 2014-10-29 2015-01-28 上海大学 Pulse signal cycle and duty ratio continuous measurement method
CN104635046A (en) * 2015-02-15 2015-05-20 金陵科技学院 Modulation domain frequency counter and continuous frequency measurement method thereof

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05312975A (en) * 1992-05-07 1993-11-26 Matsushita Electric Ind Co Ltd Frequency discriminator
CN101206235A (en) * 2006-12-22 2008-06-25 上海贝岭股份有限公司 Method for measuring frequency of single-chip
CN102841247A (en) * 2012-08-30 2012-12-26 惠州三华工业有限公司 Detection method for grid frequency
CN102901870A (en) * 2012-08-30 2013-01-30 河南科技大学 Frequency testing system based on singlechip and testing method using same
CN202886465U (en) * 2012-08-30 2013-04-17 河南科技大学 Frequency test system based on single-chip microcomputer
CN104316775A (en) * 2014-10-29 2015-01-28 上海大学 Pulse signal cycle and duty ratio continuous measurement method
CN104635046A (en) * 2015-02-15 2015-05-20 金陵科技学院 Modulation domain frequency counter and continuous frequency measurement method thereof

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108761201A (en) * 2018-04-04 2018-11-06 何晓龙 bit stream frequency measuring device and method
CN108761201B (en) * 2018-04-04 2020-05-22 何晓龙 Bit stream frequency measurement device and method
CN109361500A (en) * 2018-10-25 2019-02-19 南通先进通信技术研究院有限公司 A method of the plesiochronous external pulse of self-correcting based on chip
CN111948579A (en) * 2019-04-29 2020-11-17 深圳市优必选科技有限公司 Detection method and detection system for terminal connecting wire
CN116057811A (en) * 2020-08-18 2023-05-02 微芯片技术股份有限公司 Frequency shift keying demodulation of wireless power transfer and related systems, methods, and devices
WO2022041965A1 (en) * 2020-08-31 2022-03-03 长鑫存储技术有限公司 Test circuit, test device and test method therefor
CN114113802A (en) * 2020-08-31 2022-03-01 长鑫存储技术(上海)有限公司 Test circuit, test device and test method thereof
CN114113802B (en) * 2020-08-31 2023-01-24 长鑫存储技术(上海)有限公司 Test circuit, test device and test method thereof
US11948650B2 (en) 2020-08-31 2024-04-02 Changxin Memory Technologies, Inc. Testing circuit, testing device and testing method thereof
CN112242828A (en) * 2020-09-11 2021-01-19 深圳市杉川机器人有限公司 Method, device and equipment for capturing pulse width modulation signal
CN113300902A (en) * 2021-03-29 2021-08-24 明峰医疗系统股份有限公司 Multichannel pulse width measurement and data transmission processing method
CN113823245A (en) * 2021-09-08 2021-12-21 富奥汽车零部件股份有限公司 Display screen brightness control method, control device and readable storage medium
CN113630108A (en) * 2021-09-18 2021-11-09 温州大学 Triangular wave signal parameter measurement circuit
CN117111537A (en) * 2023-10-23 2023-11-24 北京科泰克科技有限责任公司 Control system and method for hydrogen system based on hydrogen controller
CN117111537B (en) * 2023-10-23 2024-01-26 北京科泰克科技有限责任公司 Control system and method for hydrogen system based on hydrogen controller

Also Published As

Publication number Publication date
CN106569032B (en) 2019-05-31

Similar Documents

Publication Publication Date Title
CN106569032B (en) A kind of detection method of signal frequency and duty ratio based on embedded microcontroller
CN104360144A (en) Method for determining zero crossing point of alternating current signal and system for determining zero crossing point of alternating current signal
CN105718715A (en) Anomaly detection method and device
CN105302383A (en) Anti-interference method and device for capacitive touch sensor
CN108226560A (en) A kind of method and device for obtaining motor slow-speed of revolution angular speed
CN104655905B (en) Related sinusoidal detection method and device
CN106597096A (en) Clock frequency monitoring method
CN103760414B (en) Based on the low speed recurrence interval collection method of anti-interference low-pass filtering
CN103176633A (en) Anti-misoperation method, anti-misoperation device and anti-misoperation system of touch screen
CN103197139A (en) Clock frequency test method and clock frequency test circuit
CN110247656A (en) The clock detection circuit of damage for phaselocked loop
US20220265109A1 (en) Method and device for controlling robot cleaner, robot cleaner and storage medium
CN106707034A (en) Pulse signal detection method based on Windows system function and multi-thread technology
CN103530195B (en) There is the observation circuit of Windowed watchdog
CN105553444B (en) Sef-adapting filter
KR102210428B1 (en) Device to estimate location of object, recording medium, method to estimate location of object, and wearable device
EP4261518A1 (en) Liquid inflow detection control method and electronic device
CN101813494B (en) Method for eliminating interference of sensor and outside thereof
CN2713741Y (en) Clock detecting circuit
CN108809299A (en) signal frequency measuring system
CN109782013A (en) Motor speed measuring method, apparatus, readable storage medium storing program for executing and electrical equipment
CN109462882A (en) Control method, device and the terminal of terminal
CN102457268A (en) Implementation method for 32-bit capture register
JP5077815B2 (en) Pulse input device
CN111174842B (en) Random number sampling method for electronic meter

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20190530

Address after: 410100 Xingsha Industrial Base (Changlong Street), Changsha Economic and Technological Development Zone, Changsha City, Hunan Province, No. 1259, Liangtang East Road

Patentee after: Kaiyuan Instrument Co., Ltd., Changsha

Address before: 410100 No. 172 Kaiyuan Road, Changsha economic and Technological Development Zone, Hunan

Patentee before: Changsha Kaiyuan Instruments Co., Ltd.