a high precision 10MHz Frequency meter
write in here:
my english is too bad, if you can understan this article, I need your help, I can share this article to edit it together(of course, you must have a googles account). Thanks.
====================================================================================================================================
Here is a very old schematic circuit, original author is Hu Ren Jie. not me!!, and this schematic published on many magazine.
but there is a few mistake in schematic. now I have corrected them, it must be the editor's mistake.
As you can see, this circuit have 8 Digit 7-Segment LED Display. and display data transmit and assign by 74164 and 74138 through AT89S51's UART. all pin is used.
two 74HC4040(it can works on 90MHz at 5V) form a 24 bit counter, use to count the input pulse; the port P2, P0, P1 of 89s51 use to read the 24 bit data, U2's Q11 connect to U3's CLk.
So, P1 read in low 8 bit, P0 read in middle 8 bit, and P2 read in high 8 bit. of course, you can adjust them according to your PCB.
We only need read three byte to form a big binary and calculate it , display it on LEDs, of cource, we need control the counter gate.
Why this circuit didn't use internal counter? because the internal counter only can "count" External CLock /12 /8 frequency.
the counter gate open/close by a AND logic ic --- 74HC08, control by 89S51's P3.2 and P3.3
The precision show in lower frequency:
because most frequency meter, or frequency counter, just only count the input pulse in a given time, use a gate to start and stop the gate.
but the time of start and stop is random relative to input pulse, so there is a quantization error , one pulse's period.
if we define the pulse's period to Ts, define frequency to Fs, then the quantization error is Ts.
if the time of measure is 1 sencond , then precision is Ts/T = 1/Fs.
So the precision related to the frequency of input signal. when the frequency of input signal is low, the precision also is low.
But if we can make the start/stop of the measure have same phase with the input signal, then the measure time equal to the whole(complete) period of input signals. so the quantization error have not related to the frequency of input signal, only is one base clock period. if the base clock period is 1 uS, the precision can achieve to 1/1000000.
but now , the measure time not is a given time , we need do calculate to get the frequency of input signal.
--------------------------------------------------------------
how to start and stop one time measure:
1. Reset:
before measure, reset the external counter---two 74HC4040's MR.
2. contoll:
let P3.3 output high level, when have input signal's rising edge, 74HC74, the D trigger's Q output a high level, make the gate open. the input pulse pass the 7408(U7) arrive to U2's clk.
same time, the rising edge of D trigger's Q output trigger the internal interrupt of 89S51, so that internal Timer be started,
once the given time(base time we defined in MCU, for example, 1 second gate) is arrived, let the P3.3 output low level, THEN, the D trigger's Q output a low level once next input pulse.
attention!! there is a little delay, it is we needed!! in this little time , the internal Timer of 89S51 works yet. stop at next input pulse arrived.
your 89S51 program must calculate it.
3. calculate:
we have got the measure time and read in the three 8 byte count of input pulse. next step is calculate it and display it on LEDs.
-----------------------------------------------------------------
my code will be pasted here later, it write in keil C.
==================================================================================
My idea:
1. 74HC4040 can works on 90MHz, so we can program to adjust the gate time so that measure high than 10MHz. of couse , measure frequency low than 1 Hz
2. change the display:
the time of measue can't be intterupt, so display need stable. but method in circuit can't do it. we can output to pc or laptop by UART, also can control by them(include time of gate).
the second method, use another mcu to recive the data of display by UART.
==================================================================================
没有评论:
发表评论