Frequency counter input stage - Page 1
Forum section: electronics / projects

author: alank2
author_rank: Super Contributor
timestamp: November 06, 2014, 03:16:18 am
content: Hi Everyone,I made a reciprocal frequency counter based on an AVR that uses its input capture to read signals between 0.5Hz and 100Mhz. It uses MC74AC4040N as a prescaler to handle signals that are too fast for the input capture, and it uses a MC74AC132N for some hysteresis, but right now only has a TTL level input.What ideas do you guys have for an input that can be switched to support different logic levels, etc. I got a MAX997 but haven't played with it too much yet. Could I feed the negative side a threshold voltage from a potentiometer for example?

author: awallin
author_rank: Frequent Contributor
timestamp: November 06, 2014, 06:15:39 am
content: how many digits of precision do you get with a 1s gate time?how are you clocking the AVR?HP has published the 53132A schematic. I haven't seen one for the newer 53230-series - if anyone finds one let us know!!http://literature.cdn.keysight.com/litweb/pdf/5989-6308EN.pdfpage 8 has the prescaler.page 18 has the two input channels. they use relays on the input for AC/DC, 1M/50R, LPF. then a pair of diodes to limit the voltage swing. Then an amplifier circuit (anyone care to find out and post a report on what is going on there?), before an ECL comparator (U55) AD96687BPZfor interfacing with an FPGA I've also seen ADCMP604BKSZ-R2 used. Maybe you can figure out from the datasheets what comparator has least jitter: MAX999, AD96687, ADCMP604 ? LT probably also has a few suitable chips.Using a good voltage reference to produce a stable -input voltage (aka trigger level) for the comparator might also be important!?If you are not doing interpolation (finding out where the rising edge of your signal is, within one clock cycle), the jitter specification might not be all that critical?AW

author: David Hess
author_rank: Super Contributor
timestamp: November 06, 2014, 07:54:56 am
content: A fast comparator will work fine if you want a DC coupled input with a variable trigger level.For general purpose applications, high impedance inputs which are compatible with x10 passive oscilloscope probes are useful because they have relatively low signal loading at the probe tip. For that you would need a low input current buffer before the MAX997 comparator. High impedance inputs are also easy to protect against damage from overload.

author: alank2
author_rank: Super Contributor
timestamp: November 06, 2014, 01:30:49 pm
content: Quote from: awallin on November 06, 2014, 06:15:39 amI'm using a 26MHz ocxo that is pretty stable even though I'm overclocking the AVR a bit with it, it works fine. log10(26000000) is 7.4 digits of precision at 1s or 8.4 digits at 10s.Quote from: awallin on November 06, 2014, 06:15:39 amThanks, I'll check it out.Quote from: awallin on November 06, 2014, 06:15:39 amThat was the level I never went to. I'm using the AVR's input capture to count the clocks between edges and using the prescaler when the signal is too fast for the AVR to keep up. It works very well and can automatically shift between enable or disable prescaler depending on the frequency of the signal. As long as it doesn't need to shift it will run back to back with no counts lost so you can measure a signal for hours and see the difference between its clock and the measured clock even if it is only a cycle or two.Quote from: David Hess on November 06, 2014, 07:54:56 amI wonder if this is really all I need. I'd rather keep it simple if I could.Thanks guys,Alan

author: alank2
author_rank: Super Contributor
timestamp: November 07, 2014, 04:30:14 pm
content: Quote from: David Hess on November 06, 2014, 07:54:56 amCan you give me an example of this David? A low input current buffer before the max997?

author: Lukas
author_rank: Frequent Contributor
timestamp: November 07, 2014, 05:20:08 pm
content: I've built a frequency counter frontend based on the TLV3502 comparator. Since it has a high impedance input, you don't need any buffer in front of it. Doesn't get much simpler.

author: David Hess
author_rank: Super Contributor
timestamp: November 07, 2014, 07:47:12 pm
content: Quote from: alank2 on November 07, 2014, 04:30:14 pmTo do this you would be duplicating the type of input circuit that an oscilloscope or frequency counter with 1 Mohm inputs use. Frequency counters are simplified somewhat so that just amounts to input protection using a bypassed series resistor, some low leakage clamping diodes, a 1 Mohm shunt resistor, and a high input impedance buffer or comparator input.To keep it simple, there are some fast FET input operational amplifiers available now like the Linear Technology LTC6268 and Analog devices ADA4891-1 which could be used as a buffer. Texas Instruments probably has something as well but I did not find anything suitable from Maxim.A fast comparator with FET or CMOS inputs could be used to combine the buffer and comparator. Texas Instruments has the TLV3501 and TLV3502 which should work.The advantage of doing it this way is that the input can have considerable protection from overload induced damage and standard x10 passive probes can be used which further protects against damage and increases the input voltage and trigger range by 10 times which could be important if the buffer and/or comparator run on a 5 volt supply.

author: alank2
author_rank: Super Contributor
timestamp: November 12, 2014, 02:18:42 pm
content: Hi David,So if I am understanding here (and please bear with me as I am often not...), there are two *styles* of input I could look at.Way 1 - might be a comparator like the TLV3501 where the signal comes in on the + and my threshold is the -. I could even use a pot to control the threshold or even a DAC to allow selectable thresholds from a uC. The input would be limited to the voltage of the device, say 0-VCC, but it could be this simple.Way 2 - a more traditional frequency counter would involve an amplifier stage that amplifies even small signals so that they go rail to rail for the comparator? Using something like the LTC6268? Wouldn't you still need the TLV3501 after it? If you could show me a quick schematic of this it would be very helpful.Quote from: David Hess on November 07, 2014, 07:47:12 pmI appreciate your time David - if you don't have time to show me a sch I certainly understand and appreciate your help either way friend.

author: David Hess
author_rank: Super Contributor
timestamp: November 12, 2014, 03:27:52 pm
content: Quote from: alank2 on November 12, 2014, 02:18:42 pmYou could add a compensated divider before the TLV3501 to increase the input voltage range.QuoteThere are a couple of ways this is typically done but the part that matters is that to get a high impedance input which is both suitable for use with passive oscilloscopes probes, a JFET or MOSFET buffer of some sort with a voltage gain of 1 is included like you would find on an oscilloscope input. The buffer is needed to keep the input bias current and input capacitance low.Using the TLV3501 neatly avoids this because it already has low input bias current and low input capacitance but if you wanted to use a faster comparator, then a separate buffer would be needed.QuoteHere is part of the schematic from of a Tektronix DC504A frequency counter which shows what is involved. Pretend that the gate of the JFET is the input to the TLV3501 comparator.R4028 provides the input resistance of 1 Mohm to ground which a passive probe will expect to work correctly. R4036 and the diodes protect the input from overload at low frequencies which would damage the input to the buffer or comparator. C4036 bypasses the input protection resistor at high frequencies. R4032 protects the input from overload at high frequencies.Also shown is the type of compensated voltage divider which can be used to increase in the input voltage range. In this case it divides the input by 5. If you plan on using a x10 passive probe then you probably do not need that.

author: alank2
author_rank: Super Contributor
timestamp: November 13, 2014, 01:33:06 pm
content: I watched some youtube videos last night about impedance and reactance, something I don't fully get.I am especially trying to understand what a resistor and capacitor in parallel accomplish. Let's take the voltage divider R4024/R4023. At DC, it is the resistors that matter, right? At DC the capacitors are not really part of things because of 1/(2*pi*F*C) they become infinity if F=0. At AC the capacitors become more important because their reactance drops, for example at 10MHz, C4021 becomes 1061 ohms and C4025 becomes 312 ohms, making them a couple magnitudes more important than the 800K/250K. In this case they will dominate what happens and the resistors become less relevant. Do I have all this right so far? Is this the importance of using RC in parallel?What about R4027 1K? What is the purpose of it? To keep an inrush from happening when switched?Is reactance something that applies to the capacitor only, like its AC resistance at a specific frequency?I saw the formula Z=sqr(resistance^2+reactance^2), does that mean that impedance is the overall resistance and reactance together?Thanks,Alan

author: dannyf
author_rank: Super Contributor
timestamp: November 13, 2014, 01:37:08 pm
content: R4027 assures that there is no loss of signal / spikes when the conditioner is switched in / out.It is a fairly typical arrangement.

author: David Hess
author_rank: Super Contributor
timestamp: November 13, 2014, 04:09:36 pm
content: Quote from: alank2 on November 13, 2014, 01:33:06 pmYou have it right. The capacitive divider does two things in this case; the ratio of capacitance compensates the divider at high frequencies and the total capacitance prevents the input capacitance from changing when the attenuator is selected. In a frequency counter these effects are not as critical as with an oscilloscope so the compensation and input capacitance are fixed instead of being adjustable.QuoteWhen AC coupling is selected, a considerable DC voltage can develop across the capacitor. The 1k resistor limits the discharge current through the switch which could damage it.QuoteYes to both although such a deep understanding it is not necessary in this case.One of the purposes of the capacitive divider is to swamp and control the effects of parasitic capacitance in the parts and layout which would otherwise determine the frequency response.