CN100354636C  Method for testing clock duty cycle and test circuit  Google Patents
Method for testing clock duty cycle and test circuit Download PDFInfo
 Publication number
 CN100354636C CN100354636C CNB031500153A CN03150015A CN100354636C CN 100354636 C CN100354636 C CN 100354636C CN B031500153 A CNB031500153 A CN B031500153A CN 03150015 A CN03150015 A CN 03150015A CN 100354636 C CN100354636 C CN 100354636C
 Authority
 CN
 China
 Prior art keywords
 clock
 counter
 measured
 signal
 reference clock
 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.)
 Active
Links
 238000010998 test method Methods 0.000 claims description 11
 230000000630 rising Effects 0.000 claims description 10
 238000006467 substitution reaction Methods 0.000 claims description 3
 238000000034 method Methods 0.000 description 4
 238000010586 diagram Methods 0.000 description 3
 230000000996 additive Effects 0.000 description 1
 239000000654 additive Substances 0.000 description 1
 238000004364 calculation method Methods 0.000 description 1
Abstract
The present invention provides a testing method and a circuit for a clock duty ratio. After logical AND operation is made to a measured clock and a reference clock, a first signal is obtained. The first signal is delivered to a first counter. Logic NOT operation is made to the measured clock, and then, the logical AND operation is made to the measured clock and the reference clock to obtain a second signal. The second signal is delivered to a second counter. The first counter and the second counter are simultaneously counted to the first signal and the second signal under the control of the same reset signal. After a period of time, count values of the two counters are read out, and correlation parameters of the two clocks are combined to be counted for obtaining the duty ratio of the measured clock. When the method of the present invention is used for testing the clock duty ratio, the relative size of frequencies of the reference clock and the measured clock are not limited.
Description
Technical field
The present invention relates to the measuring technology in the moving communicating field, refer to a kind of method of testing and test circuit of clock duty cycle especially.
Background technology
The method of test clock dutycycle is in the prior art: utilize reference clock to come respectively high level and the low level time of measured clock in oneperiod to be counted respectively, then by calculating.
Suppose: high level is carried out test count, and to obtain count value be C
_{1}, low level is carried out test count, and to obtain count value be C
_{2}
So: the dutycycle of calculating the measured clock of gained is:
${D}_{x}=\frac{{C}_{1}}{{C}_{1}+{C}_{2}}$
The error that produces in the test mainly comes from the count value C of counter
_{1}And C
_{2}± 1 error.
Obviously compare when the frequency of reference clock and the frequency of measured clock, low more then test ± influence that 1 error is brought is just big more, on the contrary more little.
If when the frequency of reference clock during less than the frequency of measured clock, that is: f
_{r}＜f
_{x}The time, the influence that test error brings is just very big, to such an extent as to can not stand, thus the meaning of testing lost.
Therefore, under the lower situation of the frequency of the relative measured clock of testing of reference clock frequency, can not count the high level and the low level time of measured clock in oneperiod again, so can not adopt traditional dutycycle method of testing.
Summary of the invention
The invention provides a kind of method of testing and test circuit of the hardcore clock duty cycle of frequency size to reference clock and measured clock.
Method of testing of the present invention comprises:
After measured clock and reference clock carried out the logical operation, obtain first signal, this first signal is delivered to first counter;
After measured clock carried out the logic NOT operation, carry out the logical operation with reference clock again, obtain secondary signal, this secondary signal is delivered to second counter;
First counter and second counter are counted first signal and secondary signal under same reset signal control simultaneously;
After waiting for a period of time, read the count value of first counter and second counter, and, calculate the dutycycle of measured clock in conjunction with the frequency of frequency, dutycycle and the measured clock of reference clock.
The dutycycle of described calculating measured clock is: read the count value of two counters, the following formula of substitution calculates:
In the formula, D
_{x}Be the dutycycle of asking measured clock, A (T) is the ratio of the count value of the count value of first counter and second counter, T
_{r}Be the cycle of reference clock, T
_{x}Be the cycle of measured clock, f
_{r}Be the frequency of reference clock, D
_{r}Be the dutycycle of reference clock, f
_{x}Frequency for measured clock.
The described standby period, can calculate the time value of the maximum when getting counter and can not overflow according to the size and the clock frequency of counter.
The big I of described counter is selected according to the requirement of measuring accuracy.
The invention provides a kind of test circuit of clock duty cycle, comprising: first with door, second and door, not gate, first counter and second counter:
Described first with the door two input ends connect measured clock and reference clock respectively, its output terminal is connected to first counter;
The input termination measured clock of described not gate, output terminal be connected to second with the door an input end;
Described second with another input termination reference clock of door, output terminal is connected to second counter;
Described first and second counters are connected with same reseting controling signal, under the control of this reseting controling signal, begin counting simultaneously, the output count value;
Behind the certain interval of time, read the count value of first counter and second counter, and, can try to achieve the dutycycle of measured clock in conjunction with the frequency of frequency, dutycycle and the measured clock of reference clock.
The dutycycle of described measured signal can be tried to achieve according to following formula:
In the formula, D
_{x}Be the dutycycle of asking measured clock, A (T) is the ratio of the count value of the count value of first counter and second counter, T
_{r}Be the cycle of reference clock, T
_{x}Be the cycle of measured clock, f
_{x}Be the frequency of reference clock, D
_{r}Be the dutycycle of reference clock, f
_{x}Frequency for measured clock.
Described counter can adopt the rising edge of clock to count.
Described counter can adopt the negative edge of clock to count.
Compare with traditional dutycycle method of testing, the present invention can solve when reference clock frequency lower than measured clock frequency, and can't carry out the difficulty that dutycycle is tested.In fact the present invention also is applicable to the situation that reference clock frequency is higher than measured clock frequency, therefore, when using method of testing of the present invention and test circuit test clock dutycycle, to the frequency relative size of reference clock and measured clock without limits, but two clocks must satisfy no correlativity.
Description of drawings
Fig. 1 is the logic circuit structure synoptic diagram that the inventive method adopted.
Fig. 2 is a test circuit connection diagram of the present invention.
Fig. 3 is the test flow chart of the inventive method.
Embodiment
One, the realization principle of the inventive method
1, the logical circuit of the inventive method is realized
Suppose to have a reference clock Clk_R and a measured clock Clk_X, utilize clock Clk_R as a reference, the dutycycle that needs test clock Clk_X, we utilize logic circuit structure shown in Figure 1 to test, and process is as follows: after two clocks directly carry out the logical operation, obtain signal Clk_M1, deliver to counter 1, simultaneously measured clock is carried out the logic NOT operation earlier after, carry out logical operation with reference clock again, the signal Clk_M2 that obtains delivers to counter 2.Two counters are counted signal Clk_M1 and signal Clk_M2 under the extra control that resets simultaneously.After having arrived certain hour, read the count value of two counters, calculate in conjunction with two clock associated arguments by software algorithm or hardware circuit again, just can draw the dutycycle of measured clock Clk_X.
2, concrete calculating formula
The cycle of hypothetical reference clock Clk_R is T
_{r}, frequency is f
_{r}, dutycycle is D
_{r}
The cycle of supposing measured clock Clk_X is T
_{x}, frequency is f
_{x}, dutycycle is D
_{x}
T wherein
_{x}, f
_{x}, D
_{r}, T
_{r}, f
_{r}All be known quantity, can obtain by additive method, and D
_{x}The unknown, its method of testing is exactly a technical problem to be solved in the present invention.
Be located at certain constantly, the initial rising edge of reference clock and measured clock differs+T
_{0}, behind T after a while, the rising edge of two clocks differs again+T for the n time
_{0}
In abovementioned time T, respectively signal Clk_M1 and signal Clk_M2 are counted respectively, can obtain with two counters:
To signal Clk_M1=Clk_X ﹠amp; The counter 1 that Clk_R counts, obtaining calculated value is C
_{1}(T).
According to logical theory, count value C
_{1}(T) can obtain like this: in the number+number of the rising edge of Clk_X between the Clk_R high period of the rising edge of Clk_R between the Clk_X high period.
Attention: when the frequency of reference clock Clk_R is the nonterminating and nonrecurring decimal times of measured clock Clk_X frequency, the number of the rising edge of Clk_R between the Clk_X high period:
In like manner: when the frequency of measured clock Clk_X is the nonterminating and nonrecurring decimal times of reference clock Clk_R frequency, the number of the rising edge of Clk_X between the Clk_R high period:
Then
To signal Clk_M2=(Clk_X) ﹠amp; The counter 2 that Clk_R counts, obtaining count value is C
_{2}(T).
In like manner can obtain:
Here the precondition of Shang Mian 1. formula and 2. formula establishment is same condition in fact, promptly is:
The ratio of the frequency of two clocks be a nonterminating and nonrecurring decimal doubly because the inverse of nonterminating and nonrecurring decimal still be a nonterminating and nonrecurring decimal, therefore, 1. formula is identical with the precondition of 2. formula establishment.And all be to satisfy such condition for the clock that any two clock crystal sources of occurring in nature generate.We claim that this condition is " irrelevance " of two clocks.
For 1. formula and 2. formula, we suppose:
............③
............④
Illustrate: 4. formula is our computed duty cycle D
_{x}Fundamental formular.
In order to access D accurately
_{x}, just must obtain T and A (T) accurately, according to " irrelevance " principle of clock, time T is nonexistent, in other words T → ∞.However, in the test process of reality, owing to be not absolute 100% to the requirement of measuring accuracy, therefore, we can find an approximate T to realize test process according to different accuracy requirements.According to test philosophy, because two rising edge clocks all differ+T at every turn
_{0}So no matter how counter is counted, A (T) is a constant A
_{0}This is a perfect condition, and in the actual test, we can read the output valve of two counters and calculate by behind the period T of interval.
Two, test circuit of the present invention
Fig. 2 is a test circuit connection diagram of the present invention, and among the figure, input is: measured clock Clk_X and reference clock Clk_R, output is: the count value C of counter
_{1}(T) and C
_{2}(T), Reset is a reset signal, counts simultaneously in order to control counter 1 sum counter 2.Also include two logical AND gates and a logic inverter in the circuit, wherein first meet measured clock Clk_X and reference clock Clk_R respectively, should be connected to first counter with output terminal of door with two input ends of door; The input termination measured clock of logic inverter, output terminal be connected to second with the door an input end; Second with another input termination reference clock of door, output terminal is connected to second counter.
The course of work of foregoing circuit is: two clocks (reference clock and measured clock) of input are delivered to counter 1 after directly carrying out the logical operation.After simultaneously measured clock being carried out the logic NOT operation earlier, carry out the logical operation with reference clock again, deliver to counter 2.Two counters are counted under extra reset signal Reset control simultaneously, and output count value C
_{1}(T) and C
_{2}(T).
In the circuit, counter can adopt the rising edge of clock to count, and also can adopt the negative edge of clock to count.
Three, method of testing of the present invention
According to test circuit figure of the present invention, method of testing flow process of the present invention as shown in Figure 3.
After the test beginning, input measured clock and reference clock;
Two counters are unified to reset, make two counters begin counting simultaneously;
After waiting for a period of time, read the count value of two counters;
With the abovementioned formula of count value substitution 4., can try to achieve the dutycycle of measured clock.
Wherein, the length of standby period can be estimated according to the size and the clock frequency of counter, and is as far as possible big, overflows but should guarantee that counter is unlikely.
Wherein, the size of counter also can be selected according to the requirement of measuring accuracy.When measuring accuracy is had relatively high expectations, can select bigger counter; When measuring accuracy requires to hang down, can select less relatively counter to test.
In addition, for formula computing method 4., can adopt software algorithm to realize; Also can adopt hardware circuit to realize, can also adopt logical device and logic software to realize.The implementation method of soft, hardware all belongs to prior art, so no longer describe in detail.
Claims (6)
1, a kind of method of testing of clock duty cycle comprises:
After measured clock and reference clock carried out the logical operation, obtain first signal, this first signal is delivered to first counter;
After measured clock carried out the logic NOT operation, carry out the logical operation with reference clock again, obtain secondary signal, this secondary signal is delivered to second counter;
First counter and second counter are counted first signal and secondary signal under same reset signal control simultaneously;
After waiting for a period of time, read the count value of first counter and second counter, the following formula of substitution calculates:
In the formula, D
_{x}Be the dutycycle of asking measured clock, A (T) is the ratio of the count value of the count value of first counter and second counter, T
_{r}Be the cycle of reference clock, T
_{x}Be the cycle of measured clock, f
_{r}Be the frequency of reference clock, D
_{r}Be the dutycycle of reference clock, f
_{x}Frequency for measured clock.
2, the method for testing of clock duty cycle as claimed in claim 1 is characterized in that: the described standby period, can calculate the time value of the maximum when getting counter and can not overflow according to the size and the clock frequency of counter.
3, the method for testing of clock duty cycle as claimed in claim 2 is characterized in that: the big I of described counter is selected according to the requirement of measuring accuracy.
4, a kind of test circuit of clock duty cycle is characterized in that comprising: first with door, second and door, not gate, first counter and second counter:
Described first with the door two input ends connect measured clock and reference clock respectively, its output terminal is connected to first counter;
The input termination measured clock of described not gate, output terminal be connected to second with the door an input end;
Described second with another input termination reference clock of door, output terminal is connected to second counter;
Described first and second counters are connected with same reseting controling signal, under the control of this reseting controling signal, begin counting simultaneously, the output count value;
Behind the certain interval of time, read the count value of first counter and second counter, can try to achieve the dutycycle of measured clock according to following formula:
In the formula, D
_{x}Be the dutycycle of asking measured clock, A (T) is the ratio of the count value of the count value of first counter and second counter, T
_{r}Be the cycle of reference clock, T
_{x}Be the cycle of measured clock, f
_{r}Be the frequency of reference clock, D
_{r}Be the dutycycle of reference clock, f
_{x}Frequency for measured clock.
5, the test circuit of clock duty cycle as claimed in claim 4 is characterized in that: described counter can adopt the rising edge of clock to count.
6, the test circuit of clock duty cycle as claimed in claim 4 is characterized in that: described counter can adopt the negative edge of clock to count.
Priority Applications (1)
Application Number  Priority Date  Filing Date  Title 

CNB031500153A CN100354636C (en)  20030729  20030729  Method for testing clock duty cycle and test circuit 
Applications Claiming Priority (1)
Application Number  Priority Date  Filing Date  Title 

CNB031500153A CN100354636C (en)  20030729  20030729  Method for testing clock duty cycle and test circuit 
Publications (2)
Publication Number  Publication Date 

CN1576863A CN1576863A (en)  20050209 
CN100354636C true CN100354636C (en)  20071212 
Family
ID=34579761
Family Applications (1)
Application Number  Title  Priority Date  Filing Date 

CNB031500153A Active CN100354636C (en)  20030729  20030729  Method for testing clock duty cycle and test circuit 
Country Status (1)
Country  Link 

CN (1)  CN100354636C (en) 
Families Citing this family (3)
Publication number  Priority date  Publication date  Assignee  Title 

US7260491B2 (en) *  20051027  20070821  International Business Machines Corporation  Duty cycle measurement apparatus and method 
US7595675B2 (en) *  20060501  20090929  International Business Machines Corporation  Duty cycle measurement method and apparatus that operates in a calibration mode and a test mode 
CN102638307B (en) *  20120509  20141203  北京理工大学  Highspeed optical returntozero code duty cycle measuring method and device thereof 
Citations (4)
Publication number  Priority date  Publication date  Assignee  Title 

US4330751A (en) *  19791203  19820518  Norlin Industries, Inc.  Programmable frequency and duty cycle tone signal generator 
US4475086A (en) *  19820331  19841002  Eastman Kodak Company  Duty cycle detector 
US6449200B1 (en) *  20010717  20020910  International Business Machines Corporation  Dutycycleefficient SRAM cell test 
CN1412947A (en) *  20021030  20030423  威盛电子股份有限公司  Buffer capable of regulating work period and its operation method 

2003
 20030729 CN CNB031500153A patent/CN100354636C/en active Active
Patent Citations (4)
Publication number  Priority date  Publication date  Assignee  Title 

US4330751A (en) *  19791203  19820518  Norlin Industries, Inc.  Programmable frequency and duty cycle tone signal generator 
US4475086A (en) *  19820331  19841002  Eastman Kodak Company  Duty cycle detector 
US6449200B1 (en) *  20010717  20020910  International Business Machines Corporation  Dutycycleefficient SRAM cell test 
CN1412947A (en) *  20021030  20030423  威盛电子股份有限公司  Buffer capable of regulating work period and its operation method 
NonPatent Citations (1)
Title 

精密低频信号频率与占空比测量电路的设计与应用 汤黎明，常本康，刘铁兵，吴敏，凌刚.医学研究生学报，第15卷第4期 2002 * 
Also Published As
Publication number  Publication date 

CN1576863A (en)  20050209 
Similar Documents
Publication  Publication Date  Title 

CA2695373C (en)  Circuit device and method of measuring clock jitter  
CN100575965C (en)  A kind of method of measuring frequency of singlechip  
CN113092858B (en)  Highprecision frequency scale comparison system and comparison method based on timefrequency information measurement  
CN102565673B (en)  Highlyreliable pulse counting test system based on FPGA (Field Programmable Gate Array)  
CN202362380U (en)  Multifunctional highprecision digital frequency meter  
CN105486919A (en)  Frequency measurement device based on FPGA  
CN103197145A (en)  Method and system of ultrahigh resolution phase difference measurement  
CN203275520U (en)  Pilot frequency signal phase coincidence detection system based on coincidence pulse counting  
CN100354636C (en)  Method for testing clock duty cycle and test circuit  
CN102928805B (en)  Multiepitope digitalized electrical energy meter tester  
CN101908012A (en)  Clock signal testing device and testing method thereof  
CN101556325B (en)  Method for quickly verifying electric energy error  
CN214895514U (en)  PWM control sequential sampling period transient frequency measuring circuit  
CN103105534B (en)  Phase difference measurement circuit and measurement method based on field programmable gata array (FPGA) identical periodic signals  
TW201303533A (en)  Method and system for measuring distance  
CN102466779B (en)  Builtin testing method for delay of trigger and circuit  
CN106569033A (en)  Highprecision fast frequency meter  
CN201341120Y (en)  Controllable delay line  
Reverter et al.  Programdependent uncertainty in periodtocode converters based on counters embedded in microcontrollers  
Deepthi et al.  PSoC embedded design for ultra low digital frequency meter  
CN201107355Y (en)  Time synchronization error measuring circuit based on CPLD technology  
CN104391175A (en)  Frequency measurement system capable of realizing wide frequency range disclosure and phase information keeping as well as frequency measurement method thereof  
CN1182402C (en)  Homosequence specific phase frequency measurement method and high accuracy frequency meter  
WO2018032644A1 (en)  Bandwidth modulation domain measurement system and method therefor  
Pardhu et al.  Design and simulation of digital frequency meter using VHDL 
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  
TR01  Transfer of patent right  
TR01  Transfer of patent right 
Effective date of registration: 20210427 Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518129 Patentee after: Glory Terminal Ltd. Address before: 518057 HUAWEI Service Center building, 1 hair Road, Nanshan District Science Park, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. 