Searching for frequency counter for low frequencies - Page 1
Forum section: electronics / testgear

author: justanothername
author_rank: Regular Contributor
timestamp: December 27, 2020, 06:49:49 pm
content: Hi everyone!I got an Iwatsu frequency counter (SC-7203) with all its problems and faults: No GPIB commands in the manual (had to reverse engineer), and no timeout in 10s mode when there is no signal.I'm searching for an inexpensive counter as secondary device. I need especiallyfastand accurate counting of sub-Hz frequencies (100mHz or less), GPIB or RS232 and an external reference Input. All the cheap models are 1Hz and up, like the BG7TBL models.Is there a device that does this job or should I think about an upgrade to a better counter? Any ideas for a suitable device?

author: radiolistener
author_rank: Super Contributor
timestamp: December 27, 2020, 07:29:03 pm
content: you can make such counter on some cheap Chinese STM32F103C8T6 dev module which cost for about 1 USD.Also can be done on any FPGA, but the price is too high

author: Hexley
author_rank: Regular Contributor
timestamp: December 27, 2020, 07:30:26 pm
content: The old HP 5316B counter ticks all the boxes -- external reference, GPIB, counts down to DC -- and is usually pretty cheap in the second hand marketplace. Might be worth a look if you can find one in your area.Note that the GPIB is actually HP-IB, so the command set is rather primitive by today's standards. Don't expect SCPI, in other words.

author: RoGeorge
author_rank: Super Contributor
timestamp: December 27, 2020, 08:38:47 pm
content: Quote from: justanothername on December 27, 2020, 06:49:49 pmSince you were considering a $200 DIY kit, maybe you want to look at a Rigol DDS from the DG4000 series. You can buy the 60MHz version and unlock it to do the same as the 200MHz version. Will cost you more than a $200 BG7TBL, but you'll also get a decent double channel DDS generator from DC to 200 MHz.It can be controlled remotely by sending SCPI commands over USB, or over LAN (has LXI). There is only one input for the counter, and the gating can be more than 10 seconds.If I were to need counting at such a slow frequencies, I will probably go for any DIY approach based on an $2 AVR, or a STM, or maybe use a cheap $10 logic analyzer as a counter with many channels, etc.

author: justanothername
author_rank: Regular Contributor
timestamp: December 27, 2020, 08:46:00 pm
content: Any specific diy projects for counters that have good millihertz resolution and fast counting of low frequencies? With good analog frontend and interface?I have a rigol dg1022 and its counter module sucks. At the moment it seems that there is definitely the need for a industrial device (as oppsite to diy) . I like the HP mentioned above.

author: jpb
author_rank: Super Contributor
timestamp: December 27, 2020, 09:13:23 pm
content: The TTi models such as the TF930 will probably do the job (I used to calibrate mine by measuring 1pps from a GPS).It has a 50MHz clock. There is no interpolation but it is continuous without a break.I paid £160 I think for mine direct from TTi (ex demo unit). They do come up on ebay from time to time.The new price is relatively high (but not as high as big name counters):https://uk.rs-online.com/web/p/frequency-counters/6654919/Have a look at the manual and datasheet - there are links from the RS entry linked above.One thing I ought to say is the display is not back-lit which may or may not annoy you. I'm not bothered and have been very happy with mine though I now tend to use my much more expensive Tektronix FCA3100 (which was roughly ten times the price).

author: bdunham7
author_rank: Super Contributor
timestamp: December 27, 2020, 09:53:21 pm
content: I'll second the HP5316B. The input controls, front end and trigger level out feature are particularly useful. There are features that seem to be unheard of on other counters. t does have a small learning curve. You may want to use the period measurement on very low frequencies instead of direct measurement because of the way it operates with an extended gate time. It is rated to 100mHz, mine appears to read directly fairly nicely down to 50mHz. It works just fine well below that, but is a bit difficult to interpret due to how the counter and overflow systems work--this is definitely and old-school instrument for those that can do some basic math in their heads and are willing to RTFM.You mentioned 'fast', obviously you'll need at least 10 seconds to measure 100mHz and probably two gate cycles to stabilize. You weren't expecting faster than that, were you?

author: David Hess
author_rank: Super Contributor
timestamp: December 28, 2020, 03:54:27 am
content: I will third the HP5316B. I have an HP5315a which is identical except for lacking GPIB and it is an excellent counter for low frequency applications.The Tektronix DC503A would also be a good choice because like the HP5315 and HP5316, it is a reciprocal counter. Earlier Tektronix counters are direct counters so not suitable for low frequencies.

author: justanothername
author_rank: Regular Contributor
timestamp: December 28, 2020, 07:23:35 am
content: @bdunham7 Interesting that you mention it. Obviously the HP can count down to 50mHz altough it has a maximum gate time of 10s. My IWATSU does this trick as well. It can count down to 1 mHz (milli!). It does this by resetting the cycle if there is no pulse after 8s. This would be fine for a standalone unit. I'm classifying current to frequency converters atm and they have a wide dynamic range, resulting in output frequencies in the lower mHz range up to several kHz. However, zero Hz is a valid output as well, when the current is to low to get the circuit working. My IWATSU will in such cases just be stuck when reading over GPIB since it keeps resetting the triggered measurement cycle in 10s gate mode waiting desperately for a valid pulse. This always results in a GPIB timeout.The second problem is that I use defined switching points where I switch over from 10s to 1s somewhere in my measurement run when I have the feeling that 1s will be short enough. Since I do classify noise in the frequency as well, I need a lot of points per step resulting in long runs even in 1s mode. But in 10s mode it takes hours for a run.Thats what I meant with a fast method for low frequency signals. Obviously you can return a value when there are two triggered pulses measured, no need to wait the whole 10s gate time. Lets say if you have 300mHz there would be a value ready after 3.3s, if you have 500mHz, there is a value ready after 2s etc. That would be very helpful for speeding up the whole automated process.

author: jonpaul
author_rank: Super Contributor
timestamp: December 28, 2020, 12:16:41 pm
content: See the old PLL freq multipliers.Easy to build with x10/100/1000 etc so your 500 mHz becomes 500 Hz at x1000.Just search it!Jon

author: justanothername
author_rank: Regular Contributor
timestamp: December 28, 2020, 12:24:54 pm
content: @ Ron that does not work in my case.firstly, the automated measurements are slower because it needs some pulses for the PLL to lock in, secondly I am not able to simply measure frequency noise since the PLL has its own low pass filter and the output frequency will be filtered by the PLL low pass.I may add that a run starts at 10µA and a frequency about 200mHz and stops at 1A with a frequency of about 35kHz. I measure about 8 load current point per decade and at least 100 measurements per point for statistics. In the lower regions I want the measurments to be done as fast as possible. So, after turning on the load every pulse after the initial pulse should produce a frequency reading.Maybe those counters with integrated buffer work that way?

author: bdunham7
author_rank: Super Contributor
timestamp: December 28, 2020, 03:53:50 pm
content: Quote from: justanothername on December 28, 2020, 07:23:35 amYou are really stretching the concept of 'frequency counter'! The quirk with the HP 5316B is that if there is an overflow count, which does happen at these low frequencies as well at higher ones with long gate times, the counter displays theleastsignificant 8 digits. I do not think it would work in your application reading frequency directly, although it does use a variable gate time and thus responds 'quickly' as you want. I set the gate time to 'MIN' to measure sub-1Hz frequencies. I looked at the Iwatsu model you have and that is also a fairly sophisticated counter. I don't know of any product that is going to easily do what you want.I would suggest using the counter to measure the period, then convert it to frequency if you need to in your computer. That will solve the gate time issue in your counter and would solve the overflow issue in the HP. The zero Hz issue would appear to be insurmountable just using the counter as-is. If you tell it to wait, it will wait. The HP will wait 105seconds according to the manual, but I haven't tested that feature. Perhaps a modification or addition to your circuit that provides a pulse after specified timeout period, say 100 seconds, and that value is considered the 'zero' in your data?

author: justanothername
author_rank: Regular Contributor
timestamp: December 28, 2020, 04:33:43 pm
content: @bdunham7 thank you for these valuable inputs.The zero Hz issue is fixable by using a newer device I'm sure. The problem is not that the counter waits, but that the counter is not responding to anything if the readout is incomplete after the GPIB trigger. I assume that newer devices let me at least clear the instrument after a read timeout.For period measurement, how does the HP counter work in your case? In the case of my Iwatsu it is just another way it displays the value. The functionality is the same, it takes exactly 10 seconds for the counter to do period measurement in 10s gate mode.I can however use 1s mode and measure frequency as well as period for lower frequencies without the GPIB stuck problem, there is no gate reset for 1Hz modes and above. In case of lower frequencies it displays alternating like this (say for input of 600mHz): 0 - 0.6 - 0 - 0.6 ... This is not really usable as well. Lets say its 200mHz then every fifth value other than 0 would display the correct result. No way for an automation script to anticipate this when there is no target frequency known.I got an external gate input option with channel B, still trying to figure out if I could use this in any way.

author: alm
author_rank: Super Contributor
timestamp: December 28, 2020, 04:55:54 pm
content: The read timeout could also due to something else, like a VISA library? I've worked in the past with instruments that would take longer to do a measurement than the transport timeout (in my case VXI-11). The solution was to just initiate the measurement but not read the result yet. Most instruments can do that, and the SCPI standard defines this behavior. Then either set the instrument to assert SRQ when the measurement is complete, or poll the instrument until it reports measurement ready (e.g. serial polling as implemented in GPIB). Would either of those solutions work for your counter?

author: justanothername
author_rank: Regular Contributor
timestamp: December 28, 2020, 05:04:43 pm
content: @alm well there is no GPIB command set documented for the counter. I used the commands from the Iwatsu VOAC7510 to reverse engineer the GPIB protocol:https://www.iti.iwatsu.co.jp/manual/pdf/voac752xh-e-v4.pdfThe commands I found are here:https://www.eevblog.com/forum/testgear/iwatsu-sc7203-gpib-no-documentation-what-to-do/msg2977334/#msg2977334As far as I know there is only G0 or G1 (those react exactly the same) to start a measurement. Another reason to get a new instrument.. I can never know if I did something wrong or it is just the way this instrument behaves, without a programming documentation.

author: bdunham7
author_rank: Super Contributor
timestamp: December 28, 2020, 05:35:03 pm
content: Quote from: justanothername on December 28, 2020, 04:33:43 pmThat is a very specific issue that I'm sure will vary between instruments. I can't tell you offhand how the HP would act in that situation. A watchdog timer would be fairly easy to make if you can't find a suitable counter that doesn't hang on long gates like yours does.QuoteThat way yours works doesn't sound sensible. I just hooked mine up and tried this using pulses from a sig gen. On the HP, if you turn the gate time to minimum (it doesn't have set 1s/10s/etc settings like many counters) it will update the period reading every other cycle. So for 500mHz, you'll always get a correct reading of 2.000xxx seconds that will update every 4 seconds. If you increase to 1Hz, then you will get correct readings that update every 2 seconds. You can't get a reading for every period because the counter can't use the same pulse as both and end point and a start point. At higher frequencies, the reading is updated at whatever the gate time is set to, which can be as little as 500uS. You never get a 'wrong' reading. I don't know what update rates are available over the HP-IB.QuoteWhat does it do if you attempt to measure the period of a slow signal (say 100mHz) but have the gate time set to 1s or 0.1s?

author: justanothername
author_rank: Regular Contributor
timestamp: December 28, 2020, 05:46:50 pm
content: Quote from: bdunham7 on December 28, 2020, 05:35:03 pmwith 1s gate time:Period measurement:it displays 10 s visible on display for one second and underflow (uuuuuuu) visible for 9 seconds. repeat.Frequency measurement:it displays 0.1 Hz visible on display for one second and 0 Hz visible for 9 seconds. repeat.

author: bdunham7
author_rank: Super Contributor
timestamp: December 28, 2020, 06:04:53 pm
content: Quote from: justanothername on December 28, 2020, 05:46:50 pmThat seems particularly unhelpful. On the HP5316B I can set the gate time to MIN on the normal range (about 60mS) and I can feed it signals from 100mHz to 100MHz and everything in between and it always correctly displays the period to at least 6 digits with update rates ranging from more than 10 per second down to the two-cycle limitation I mentioned before. If you suddenly change the frequency there will be one intermediate reading, but no incorrect or zero readings at all.It sounds to me like the HP would work for you if you can use period measurements and can solve your zero issue somehow. I'm reasonably sure the HP would accept a reset command over the HP-IB bus even if it were waiting with an open gate. I can drag out my NI GPIB adapter sometime when I have more time and verify that if you need to know for sure.You mentioned wanting the external reference feature as well. Is there a particular reason you need that for this application?

author: justanothername
author_rank: Regular Contributor
timestamp: December 28, 2020, 06:17:50 pm
content: @bdunham7 I'm allready on it to get this counter. The external ref input is just because I got a GPSDO, for some tasks like LFXO verification (with FET probe) it is convenient, because I do not have to mention the error of the internal reference in my reports. I just assume that the GPSDO is flawless for this purpose.What is the difference between the 5316B and the 5316A? I could only find the difference between 5316B and 5315A.

author: bdunham7
author_rank: Super Contributor
timestamp: December 28, 2020, 07:30:46 pm
content: Quote from: justanothername on December 28, 2020, 06:17:50 pmI've never figured that out. The 5316A has a top handle, but otherwise appears to have the same external features. The manuals indicate that they were both produced concurrently, although many of the 5316B models found in the real world seem to be newer. It is interesting that they are so similar but have separate manuals--there must be some reason. You could read those manuals and look for differences. Or maybe someone here has both and can tell us.

author: justanothername
author_rank: Regular Contributor
timestamp: December 29, 2020, 03:37:35 pm
content: Just a little follow up. I got the counter today, a 5316B. It works as expected. No need to set it in period mode it has variable gate in frequency mode as well.Thank you very much for all the advice!

author: bdunham7
author_rank: Super Contributor
timestamp: December 29, 2020, 04:15:57 pm
content: Quote from: justanothername on December 29, 2020, 03:37:35 pmYes, but watch for the overflow issue. I tested mine a bit more and found that it reads directly without overflow down to exactly 1/7 Hz (142 mHz) and from 141mHz down to its rated 100mHz, it shows overflow, essentially a correct reading missing the leading '1'. I actually found a reference in the manual that states that this is how it works. Make sure you know what you are looking at if you go below 1/7 Hz!Period mode puts out completely unambiguous data from 10uHz (105seconds) to 100MHz+.

author: justanothername
author_rank: Regular Contributor
timestamp: December 29, 2020, 04:26:30 pm
content: @bdunham7 Yes I see, I could reproduce this behavior with 50mHz.I'm at 100mHz in period mode right now and the displayed period is incorrect, says between 1.8s and 5.4s. I will quickly switch over to the Rigol DG1022 and check whether the analog discovery has a problem or the counter.Edit: It seems that the analog discovery has a problem. With the Rigol AWG it works perfectly down to 50mHz.Edit2: funny, I got the Rigol with 50mHz connected to the counter and I get correct frequency readings without overflow indicator for several minutes now. What do I have to do to reproduce that error?

author: bdunham7
author_rank: Super Contributor
timestamp: December 29, 2020, 05:08:35 pm
content: Quote from: justanothername on December 29, 2020, 04:26:30 pmBelow 142 mHz the overflow will come and go. I imagine they just didn't try to 'finish' the software--or maybe didn't have room--in the lower frequency ranges, probably thinking anyone at those levels would be using period. Try 142mHz, then change to 141mHz. Below that, the overflow will come and go--it actually reads without overflow at 50mHz, but you can't distinguish between 20 mHz and 30 mHz because of the overflowbugfeature.The overflow is a feature and not a bug at higher frequencies because it allows you to gain resolution by increasing gate time. So if you select minimum gate time and an input of 100 MHz, you'll see 100.000xx MHz, then as you increase gate time, you will gain a digit, then the whole thing shifts left and you get another digit but you lose the leading '1' and the OVFLW light comes on. Then if you put the gate time all the way up, you get another digit, so the reading is 0.00000xx. If you have a known CW signal, you can get 10 digits precision that way. Unfortunately, when they implemented the very handy auto-variable gate time for low frequencies and long periods, they didn't optimize the interaction between the gate time and the overflow operation in reciprocal mode.

author: justanothername
author_rank: Regular Contributor
timestamp: December 29, 2020, 05:23:46 pm
content: Quote from: bdunham7 on December 29, 2020, 05:08:35 pmYes you are right, 141mHz does light the ovf! Weird.Your knowledge is very valuable. The instruments you use (or at least the one in this case) are fairly old, but you know them with all their limitations and tricks. And to have experts like you giving this knowledge back to the community is a thing of immense worth.

author: Raindog
author_rank: Contributor
timestamp: December 29, 2020, 05:41:35 pm
content: I guess I'll chime on in and fourth the HP5316B as well. However I use a HP 5371A Frequency and time interval analyzer, it goes from DC to 500 MHz and will give you many other features not found on the HP 5316B, such as resolution down to nHz or pHz depending on measurement parameters and frequency. Unfortunately it's the same size as a HP 8644A, big, bulky and heavy.EDIT: I re read the spec sheet and this instrument has an input range of 125mHz - 500 MHz.

author: justanothername
author_rank: Regular Contributor
timestamp: December 29, 2020, 06:08:22 pm
content: Frequency and time analyzers...I took a look at those units. They are still expensive and heavy, but nonetheless nice. I guess a real upgrade would be gapless aquisition, if this exists. At the moment I guess most of the statistical analyzing can be done as soon as I got a python module set up.

author: joeqsmith
author_rank: Super Contributor
timestamp: December 30, 2020, 12:51:20 am
content: My old HP5328A. Tied to GPS and GPIB. Sadly my 33120A does not have the external reference input. Shown looking at 20mHz.Sorry, it looks like the security problem with uploading pictures is back.

author: Raindog
author_rank: Contributor
timestamp: December 30, 2020, 07:53:06 am
content: Nice old counters, I used to have one I bought back in 1997, a shorted pass transistor in the PS section rendered it a parts unit after 23 years of use. I replaced it with a HP 5334B. I like this counter much better since it has more functionality, a 1.3 GHz channel option and of course the 10811A over the 10544A reference my HP 5328A had. I am as of this writing duplicating your 20 mHz input from my HP 3325A and showing 20.0050048 mHz. I have never taken this counter this low so I figured I'd give it a try, works great!

author: David Hess
author_rank: Super Contributor
timestamp: December 31, 2020, 04:04:23 pm
content: Quote from: jonpaul on December 28, 2020, 12:16:41 pmSome old direct counters did exactly that to extend their resolution at low frequencies with reasonable gate times. The Tektronix DC504A and DC508 include x100 multipliers for measurements up to 25 kHz.

author: justanothername
author_rank: Regular Contributor
timestamp: January 02, 2021, 03:50:29 pm
content: I recently finished the python driver:https://www.eevblog.com/forum/testgear/hp-5316ab-python-driver/and today I programmed a little tkinter app to read frequencies (in period mode) and plot it with histogram.The only thing that I'm not able to get to work is the digital level setting.What I'm doing is:Code:AS1TR1AT+1.5My signal goes from +3V to 0V. If I use TR0 and use front panel settings (I can read the level back with the trigger level outs) with negative slope and 1.5V trigger level it works. Above commands do not seem to work..

author: joeqsmith
author_rank: Super Contributor
timestamp: January 02, 2021, 05:54:25 pm
content: On your graph, the frequency is measured in what?Is the counter's trigger the dominant noise?

author: justanothername
author_rank: Regular Contributor
timestamp: January 02, 2021, 06:06:28 pm
content: @joe the unit is Hz.The noise comes from the DUT. Its a current to frequency converter with a lot of noise in the lower ranges. This program is written to help me to see if any changes in the circuit will lower the noise significantly.

author: bdunham7
author_rank: Super Contributor
timestamp: January 02, 2021, 06:31:13 pm
content: What is the waveform output of your device? I had previously understood it to be a pulse, but I'm not sure if you actually said that. And why negative slope specifically?

author: justanothername
author_rank: Regular Contributor
timestamp: January 02, 2021, 06:35:49 pm
content: Quote from: bdunham7 on January 02, 2021, 06:31:13 pmIts an open drain output with pullup and looks like this.

author: joeqsmith
author_rank: Super Contributor
timestamp: January 02, 2021, 09:33:58 pm
content: Makes more sense now. I looked at the manual for your counter and the commands are different from mine. You could try posting your source for the program and see if anyone else with the same counter could possibly help you out with the commands.I was thinking you were running sub Hz tests and the 74 seconds was the period but the frequency obviously made no sense. When I saw the Gaussian shape, but such a wide spread, I assumed you were beyond testing your setup.I have generic software for my test equipment so just for fun, here's the HP33120A set to 38Hz, 0-3V square wave. HP5328A is again locked to the GPS. Using 50 ohms and setting the trigger level to a volt. Histogram bins were set to give enough resolution to see the steps with the counter.If you post your circuit, people may be able to offer some suggestions on how to improve it.

author: joeqsmith
author_rank: Super Contributor
timestamp: January 03, 2021, 05:13:59 am
content: Both RF generators are tied to the GPS. I used an old Xilinx FPGA demo board to divide the clock down to 38.6Hz. The standard deviation went from 747u down to 250. P-P is improved. I played a bit with the trigger level and drive strength but it made no difference.

author: justanothername
author_rank: Regular Contributor
timestamp: January 03, 2021, 01:19:24 pm
content: I figured it out. The driver was working correctly all along. Stupid mistake I made: I forgot that the active FET probe is of x10 type. Must set the level to +0.15V to get it working.I added frequency over time display to my software. This software is not meant for the public since it is quickly written and maybe full of bugs and copypaste errors.It works quite okay nonetheless. If anyone wants it for some reason, just send me a message, I'll send you a link then.

author: joeqsmith
author_rank: Super Contributor
timestamp: January 03, 2021, 10:01:40 pm
content: Good to hear you sorted it out.I ditched the RF generator and tied the GPS (I have a clock distribution driver) directly to the FPGA board. Interesting is that it appears bimodal. The standard deviation is a wash.Of course, if I switch to frequency, we don't have near enough resolution and end up with a histogram consisting of a vertical line.The manual for my old counter provides some information on expected noise.

author: justanothername
author_rank: Regular Contributor
timestamp: January 03, 2021, 10:53:54 pm
content: @joe Interesting. I dont get it. What is the essential difference between period and frequency mode in your counter, especially if you set a long gate time? Is the schmitt trigger working differently in period mode? Is there no averaging of multiple measured periods within the gate time?

author: joeqsmith
author_rank: Super Contributor
timestamp: January 04, 2021, 01:36:42 am
content: I am not sure if BAMA is still available to the public. Chapter 4 covers the operation and sources of error. The technical manual may be found here:http://ftb.ko4bb.com/getsimple/index.php?id=manuals&dir=HP_Agilent/HP_5328_Universal_CounterYes, it does support an average period but I have not been using it to make these measurements. The frequency selection knob acts as the number of averages, N. I do not show this in my software. In a similar boat in that nothing I write is really something for the masses.I'll go ahead and try it with the highest average without overflow, keeping everything else the same. Should be much tighter but slower.

author: joeqsmith
author_rank: Super Contributor
timestamp: January 04, 2021, 04:00:42 am
content: Same setup with FPGA clocked directly from the GPS and then driving the counter. Actually, that's not quite true. I have an LVDS differential driver on that interface board that drives the FPGA at half the input clock.https://www.eevblog.com/forum/microcontrollers/typical-speed-of-fpgas/msg1279898/#msg1279898Setting N=100 will cause an overflow but I can run it at N=1, save the upper digits, then prepend them to the over ranged value. It's prettyslow but you can see the standard deviation has now gone from 250u down to 2.5u. I had to add a couple digits to the histogram.Not sure if using this technique would be useful for your particular application or not.

author: justanothername
author_rank: Regular Contributor
timestamp: January 04, 2021, 10:37:54 am
content: The overrange trick works as well with my counter, but for my application I'd be happy if my circuit has a deviation less than 0.1%. At the moment I'm more like 10% in the lower ranges.It is low power (2.3µA Iq) 6 decades of current to frequency converter, not easy to get enough precision while maintaining low power consumption. I'm working on this since months.Actually your software looks pretty useful, I've seen it before in some other videos and always wondered if it is available anywhere.

author: joeqsmith
author_rank: Super Contributor
timestamp: January 04, 2021, 03:17:43 pm
content: Is the project for the fun of it or for your work? If its for the fun of it, I'm curious what frequency range and other constraints you have placed on yourself. Of course, what the heck's it for?Being the lazy person I am, I tend to reuse code. Most of my programs have a similar look.

author: justanothername
author_rank: Regular Contributor
timestamp: January 06, 2021, 11:13:31 am
content: Quote from: joeqsmith on January 04, 2021, 03:17:43 pmI can tell you in a private message if you like.