Author Topic: Frequency Counter Project  (Read 13839 times)

0 Members and 1 Guest are viewing this topic.

Offline Gandalf_SrTopic starter

  • Super Contributor
  • ***
  • Posts: 1729
  • Country: us
Frequency Counter Project
« on: September 07, 2014, 12:53:31 pm »
I'm starting a frequency counter design based off http://lea.hamradio.si/~s53mv/counter/counter.html by S53MV but I'm trying to make a few enhancements, some of which are driven by the fact that some components used seem to be no longer available.

I'm aiming to use a PIC16F883 running at 5 volts, that matches the original design and the 2x20 LCD I'm aiming for is also 5V.  For better accuracy, I could use an external ±0.5ppm TCXO device such as this http://www.digikey.com/product-detail/en/ASVTX-09-20.000MHZ-T/535-9702-1-ND/1578302 which theoretically is available in a 5V version but that is not listed by any major supplier.

The data sheet for the ASVTX-09-20.000MHZ-T says that it has a clipped sine wave output voltage that's 0.8Vp-p min.  If I want to drive the OSC1 pin of the PIC (running  at 5V) using the 3V version of this oscillator, I think I will need some kind of level translation.  Or maybe the schmidt trigger section in the PIC input stages takes care of that?

I have a lot of experience with PICs but the real question here is how to drive OSC1 using the output from the Oscillator block, especially because of the voltage differences.  Any advice is welcome.

Thanks,
If at first you don't succeed, get a bigger hammer
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency Counter Project
« Reply #1 on: September 07, 2014, 02:08:00 pm »
Quote
I'm trying to make a few enhancements

I would suggest a few changes:

1) the prescaler can be done with something simpler / faster, like MB506 or MC100EL family of counters -> those guys go all the way to Ghz.

2) you may want to think about if you want to read prescalers. It adds to some hardware complexity and lots of software complexity.

3) input signal conditioner: may be a few gates connected as linear amplifier.

Quote
using the 3V version of this oscillator,

A few options:

1) you can run the 3v oscillator at 5v - I have done that for many oscillators, and TCO-919 most recently;

2) you can run the pic at 3v. The lcd can still run at 5v or you can use a charge pump to create a negative voltage to drive the contrast.

3) even if you run the oscillator at 3v and the pic at 5v, they are likely to work gotether.

4) if not, run the oscillator's output through a not/nand gate + feedback resistors and call it a day. See my TCO-919 thread - the Vpp there is less than 100mv or even smaller, as I recall.
================================
https://dannyelectronics.wordpress.com/
 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: Frequency Counter Project
« Reply #2 on: September 07, 2014, 02:10:39 pm »
The problem is the 0,8V output of the oscillator. A simple transistor amplifier driven off the 5V supply will have enough gain but it would be better if you chose an oscillator with either CMOS or TTL output levels.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency Counter Project
« Reply #3 on: September 07, 2014, 02:18:42 pm »
Quote
The problem is the 0,8V output of the oscillator.

It may not be a problem. Give it a try and it doesn't pay to over-engineer it.
================================
https://dannyelectronics.wordpress.com/
 

Offline Gandalf_SrTopic starter

  • Super Contributor
  • ***
  • Posts: 1729
  • Country: us
Re: Frequency Counter Project
« Reply #4 on: September 07, 2014, 02:47:46 pm »
Quote
The problem is the 0,8V output of the oscillator.

It may not be a problem. Give it a try and it doesn't pay to over-engineer it.
I believe that the OSC1 & OSC2 inputs are not normal logic level inputs; if you scope the OSC1 pin whicle it's running on an external crystal, you only get about 1 volt-pp for the sine wave signal so it might just work anyway.

If I took the whole 74LVC109 - 74AC74 - PIC chain and ran it on 3.3 volts, then I could use the oscillator block and figure out how to interface with the LCD, or I could double the display price to $30 and use an OLED that's rated at 3.3 volts.  There are many possibilities on the display side.

I struggled to find the 2N3960 and have found a close replacement, the DSC3G03, I'm sure there'll be tweaks to get that interface running.

I actually have already developed a working PIC frequency counter project but the front end is useless.
If at first you don't succeed, get a bigger hammer
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency Counter Project
« Reply #5 on: September 07, 2014, 02:59:01 pm »
Quote
I struggled to find the 2N3960

Do you have access to the internet / distributors / ebay? I would venture to guess that any 1Ghz+ npn would work.

I would also check out jfets / dual gate mosfets (bf998 for example). If you think you will stay with 50ohm input, those MMIC are also quite wonderfully cheap.

Not to mention the use of logic gates here.

Quote
the front end is useless

Check out those service manuals from HP.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency Counter Project
« Reply #6 on: September 07, 2014, 03:00:19 pm »
If you are willing to stay with a 50ohm input, think about a common base amplifier, or a cascode input stage.
================================
https://dannyelectronics.wordpress.com/
 

Offline Gandalf_SrTopic starter

  • Super Contributor
  • ***
  • Posts: 1729
  • Country: us
Re: Frequency Counter Project
« Reply #7 on: September 07, 2014, 08:53:21 pm »
If you are willing to stay with a 50ohm input, think about a common base amplifier, or a cascode input stage.
Thanks, don't know whether or not you read the full design that I linked to but that it has 3 different input stages: a TTL, an RF, and a microwave (5 GHz with prescaler).  The main schematic takes input from one of those stages (at 50 Ohms I think) and the matching is done by the 2N3960 feeding into the 74F50109.  S53MV has told me that changing the first flip-flop to a 74LVC109 followed by a 74AC74 will require different pull ups to match the devices to the bipolar inputs of the PIC but I can't get the 74F50109 so I'm planning on using the 74LVC109.

Any circuit schematic links for suggested changes would be useful, I'll pull the design schematic together and post it up here.  I'll also share the board design for those interested enough.
If at first you don't succeed, get a bigger hammer
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency Counter Project
« Reply #8 on: September 07, 2014, 09:09:08 pm »
Those are fairly weird devices.

If the MB or MC100EL devices are two exotic for you, try 393 or 4040 counters -> 393 is more flexible and 4040 is all in one. Many of they go over 150Mhz and some over 200Mhz -> more than sufficient for this application.

And the counting can be stopped by the mcu - making the reading of the prescaler very easy.

================================
https://dannyelectronics.wordpress.com/
 

Offline DmitryL

  • Regular Contributor
  • *
  • Posts: 242
  • Country: gb
Re: Frequency Counter Project
« Reply #9 on: September 07, 2014, 10:11:54 pm »
I'm starting a frequency counter design based off http://lea.hamradio.si/~s53mv/counter/counter.html by S53MV but I'm trying to make a few enhancements, some of which are driven by the fact that some components used seem to be no longer available.

Err.. Looks like rubbish to me  :)
Whan about a reciprocal Freq. counter based on EPM3064 & ATMega8 ? 100Mhz bandwidth (without a prescaler), interpolator for measuring pulse width, proper analog frontend, etc. ?  If you ask the author nicely, he will also give you a source code, otherwise, only schematics, PCB layout and firmware avalaible :)
http://www.cqham.ru/forum/showthread.php?t=20109
That project cost me about 30 GBP in parts.

ops, it is in Russian ;)
 

Offline Gandalf_SrTopic starter

  • Super Contributor
  • ***
  • Posts: 1729
  • Country: us
Re: Frequency Counter Project
« Reply #10 on: September 07, 2014, 10:30:31 pm »
The 74LVC109 can count up to almost 200 MHz so that's why it's favored as the best part to replace the 74F50109.  I could:

1. Stick with the original design as closely as possible.
2. Put an ECL counter like the MC100E137FNR2G as the front end, that would count up to 1.5 GHz and still give full digit count down to 1 Hz using the 74LVC109+74AC74+PIC counter.  But what about the input stage?  Are there good examples of input stages for this chip?
3. Put an ECL counter like the MC100E137FNR2G as the front end and then add a PIC24 or PIC32 or some other microcontroller that can count at 200 MHz and then get the first 8 bits from the front end ECL chip and the final 24 as a counter in the PIC.

As always, the front end is my problem.
If at first you don't succeed, get a bigger hammer
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency Counter Project
« Reply #11 on: September 07, 2014, 10:47:40 pm »
Quote
add a PIC24 or PIC32 or some other microcontroller that can count at 200 MHz

You may have to wait for  a few decades for that kind of chips to be made.

I think sticking with the original design, without any modification, is probably the best course of action for you.

================================
https://dannyelectronics.wordpress.com/
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19497
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Frequency Counter Project
« Reply #12 on: September 07, 2014, 11:11:56 pm »
Quote
add a PIC24 or PIC32 or some other microcontroller that can count at 200 MHz

You may have to wait for  a few decades for that kind of chips to be made.
Nope. The Xilinx Zynq family has been available for several years; there are many dev boards available.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: Frequency Counter Project
« Reply #13 on: September 08, 2014, 01:49:38 am »
Quote
add a PIC24 or PIC32 or some other microcontroller that can count at 200 MHz

You may have to wait for  a few decades for that kind of chips to be made.
Nope. The Xilinx Zynq family has been available for several years; there are many dev boards available.

Heck, even a little old $25 Spartan 6 FPGA - about 5 years old - can count at 950MHz, using a single flip-flop as a 2:1 prescaler (see http://hamsterworks.co.nz/mediawiki/index.php/High_Speed_Frequency_Counter).

And it is a heck of a lot easier to engineer a PCB for, given that is available in TQFP package
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline salbayeng

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: au
Re: Frequency Counter Project
« Reply #14 on: September 08, 2014, 07:03:02 am »
Prescaler: Some time back NatSemi made the LMX23xx range of synthesisers,  You could use one of these (or a modern equivalent), ignoring the VCO aspect.
It has a  programmable prescaler in it , so GHZ in , MHZ out , with an SPI interface.  OR you could use the reference divider to make some programmable frequency source.

Re connecting clock to PIC , just connect a 100k? resistor between X1 and X2  (this gives the correct DC bias to get 50% duty cycle)  and capacitively (100pF?) connect the clock to X1 .
One way to look at this is you have made an injection locked RC clock.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19497
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Frequency Counter Project
« Reply #15 on: September 08, 2014, 09:26:16 am »
Quote
add a PIC24 or PIC32 or some other microcontroller that can count at 200 MHz

You may have to wait for  a few decades for that kind of chips to be made.
Nope. The Xilinx Zynq family has been available for several years; there are many dev boards available.

Heck, even a little old $25 Spartan 6 FPGA - about 5 years old - can count at 950MHz, using a single flip-flop as a 2:1 prescaler (see http://hamsterworks.co.nz/mediawiki/index.php/High_Speed_Frequency_Counter).

And it is a heck of a lot easier to engineer a PCB for, given that is available in TQFP package
Just so. Given that is it often difficult to coerce two radically different technogies into the same package (and company!), it is often cheapest to simply mount two packages on a PCB.

But the original point was about a counter and cpu in the same package and, softcores excepted, the Zynq is the best current exemplar.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency Counter Project
« Reply #16 on: September 08, 2014, 10:27:21 am »
Quote
add a PIC24 or PIC32 or some other microcontroller that can count at 200 MHz

You may have to wait for  a few decades for that kind of chips to be made.
Nope. The Xilinx Zynq family has been available for several years; there are many dev boards available.

Heck, even a little old $25 Spartan 6 FPGA - about 5 years old - can count at 950MHz, using a single flip-flop as a 2:1 prescaler (see http://hamsterworks.co.nz/mediawiki/index.php/High_Speed_Frequency_Counter).

And it is a heck of a lot easier to engineer a PCB for, given that is available in TQFP package
Just so. Given that is it often difficult to coerce two radically different technogies into the same package (and company!), it is often cheapest to simply mount two packages on a PCB.

But the original point was about a counter and cpu in the same package ...

I thought it said something about a PIC24 or PIC32 that can count to 200Mhz.

A re-reading may be helpful.
================================
https://dannyelectronics.wordpress.com/
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19497
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Frequency Counter Project
« Reply #17 on: September 08, 2014, 11:51:04 am »
Quote
add a PIC24 or PIC32 or some other microcontroller that can count at 200 MHz

You may have to wait for  a few decades for that kind of chips to be made.
Nope. The Xilinx Zynq family has been available for several years; there are many dev boards available.

Heck, even a little old $25 Spartan 6 FPGA - about 5 years old - can count at 950MHz, using a single flip-flop as a 2:1 prescaler (see http://hamsterworks.co.nz/mediawiki/index.php/High_Speed_Frequency_Counter).

And it is a heck of a lot easier to engineer a PCB for, given that is available in TQFP package
Just so. Given that is it often difficult to coerce two radically different technogies into the same package (and company!), it is often cheapest to simply mount two packages on a PCB.

But the original point was about a counter and cpu in the same package ...

I thought it said something about a PIC24 or PIC32 that can count to 200Mhz.

A re-reading may be helpful.
I'm sorry, I'm being a bit slow today: what's your point?
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Strada916

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: au
Re: Frequency Counter Project
« Reply #18 on: September 08, 2014, 12:07:25 pm »
The Bone, the Off-White, the Ivory or the Beige?
 

Offline BloodyCactus

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
    • Kråketær
Re: Frequency Counter Project
« Reply #19 on: September 08, 2014, 04:53:29 pm »
that looks like an interesting article. thanks for the link
-- Aussie living in the USA --
 

Offline Gandalf_SrTopic starter

  • Super Contributor
  • ***
  • Posts: 1729
  • Country: us
Re: Frequency Counter Project
« Reply #20 on: September 08, 2014, 05:15:53 pm »
Yes, thanks.  It looks interesting but I have to pay $9 just to get Pt1 of the article.  :(
If at first you don't succeed, get a bigger hammer
 

Offline BloodyCactus

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
    • Kråketær
Re: Frequency Counter Project
« Reply #21 on: September 08, 2014, 05:56:38 pm »
Yes, thanks.  It looks interesting but I have to pay $9 just to get Pt1 of the article.  :(

yeah I was looking more, no PDF, the 'online' version is FLASH ugh. so much for buying the online and printing the article. sigh.
-- Aussie living in the USA --
 

Offline Strada916

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: au
Re: Frequency Counter Project
« Reply #22 on: September 08, 2014, 06:12:21 pm »
Those of us in Australia can go to your local reference library. Goto shelf 621 in journals and get copies that way. Glandulf_Sr pm sent.
The Bone, the Off-White, the Ivory or the Beige?
 

Offline BloodyCactus

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
    • Kråketær
Re: Frequency Counter Project
« Reply #23 on: September 08, 2014, 07:04:54 pm »
Those of us in Australia can go to your local reference library. Goto shelf 621 in journals and get copies that way. Glandulf_Sr pm sent.

if I can drag the wife away from her parents here in the usa and move back home I'll try that out :(
-- Aussie living in the USA --
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency Counter Project
« Reply #24 on: September 09, 2014, 10:42:17 am »
There is an 8-bit counter implemented by someone from Korea. It basically follows the approach I laid out earlier: for the 2.5Ghz input, mmic pre-amplifier, mb506 divider; for the 10Mhz (or 100Mhz) input, jfet preamplifier. Signal then goes to a 393 read parallelly by the mcu.

Frequency meters are some of the simplest to implement over a mcu. I posted an example where the only part is a 4-digit led sitting onto of a mcu. It counts up to 20Mhz and displays the 8-digit output on a 4-digit led.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf