Author Topic: Frequency meter with 0.1ppm resolution  (Read 7541 times)

0 Members and 2 Guests are viewing this topic.

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #25 on: April 20, 2020, 02:55:26 pm »
For now the results are good. Response time of ZCD module is below 200ns and the jitter is low enough to take very accurate measurements.
It could be a good alternative to the tipical Schmitt trigger in order to transform analog signals.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #26 on: April 20, 2020, 03:07:10 pm »
The problem with Zero Crossing Detection is that it is not too immune to noise and sometimes the output has multiple pulses where it should only have one (the output oscillates)
I have encountered this problem with square signals that have an added level of DC voltage and negative values close to zero.
In these cases it is better to add a capacitor to completely eliminate the continuous component of the signal, and the module starts working properly.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #27 on: April 21, 2020, 03:06:17 pm »
Today I have prepared the program to accept two system clock frequencies without reprogramming the microcontroller. The main frequency from simple crystal of 8MHz and the secondary frecuency of 5MHz from a precise OCXO of 10MHz divided by 2.

I have done overclocking test and the microcontroller directly accepts a frequency of 10MHz with internal multiplication by PLL up to 40MHz. But the microcontroller's specifications are 32MHz maximum and I don't trust overclocking at all.

Now I have a problem with the settings. At this time only the unstable frequency of the 8MHz oscillator can be compensated.
Should it also allow offsetting by software the frequency of the OCXO precision oscillator?
I'm a little tired of having to add so many options.

Regards.
 
The following users thanked this post: KK6IL

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #28 on: April 22, 2020, 09:38:45 am »
Ok, In the end I have prepared an offset for both frequencies, just in case.

Today I am working with the calculation of phase diferences between two signals.
The preliminary results are quite good. The microcontroller can calculate phase shifts with a resolution close to nanosecond.

When comparing 2 signals with close frequency, it is difficult to know exactly what the difference in frequency is. From the eighth decimal place the noise is very high. However with the phase difference measurement, the frequency differences can be measured very accurately.

Here attached a preliminar result from an excel datasheet.
The frequency of both measured signals is very close with 10000.2554 Hz versus 10000.2560 Hz, with a very small difference in the last decimal place.
With the phase difference, you can easily see the frequency difference much more precisely. The average difference is 67.46 ns per second.

The phase difference has an offset of at least 250us. This is the time it takes for the microcontroller to take the two measurements.

Regards.

 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #29 on: April 22, 2020, 01:00:23 pm »
Now I'm thinking about the PCB.
Perhaps I should prepare a schematic for mounting the frequency counter on a breadboard in case someone wants to test it without making or buying a PCB.
Is anyone interested in testing the frequency counter? it would be very helpful for me to have beta testers.

Regards.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #30 on: April 22, 2020, 04:02:31 pm »
I'm looking for a source oscillator cheap, but more precise than a simple crystal.
I have found this board in ebay:
https://www.ebay.com/itm/High-Accuracy-RF-Frequency-Counter-Meter-1-500-MHz-Tester-Module-For-ham-Radio/313035221538?hash=item48e25a6a22:g:Yy0AAOSwx9pedJG~

It uses an VC-TXCO in a 5032 package. It frequency stability is ± 2.5 ppm and low cost because all the PCB cost only $15.
I don't have good experience with TCXO. On one occasion I bought one TCXO (cost $2.80) that maintained a stability of 2.5ppm but with a lot of jitter.

Example of measurements of my TXCO every second with jitter (ECS-TXO-5032-250-TR):
Code: [Select]
Frequency Error PPM
4999993.98 -1.204
4999996.09 -0.782
4999996.94 -0.612
4999996.95 -0.61
4999997.41 -0.518
4999994.83 -1.034
4999996.14 -0.772
4999995.71 -0.858
4999998.15 -0.37
4999994.95 -1.01
4999996.9 -0.62
4999996.13 -0.774
4999996.91 -0.618
4999998.13 -0.374
4999994.9 -1.02
4999998.13 -0.374
4999994.91 -1.018
4999998.09 -0.382
4999996.08 -0.784
4999994.89 -1.022
4999998.05 -0.39
4999994.88 -1.024
4999996.06 -0.788
4999998.07 -0.386
4999996.07 -0.786
4999994.85 -1.03
4999996.03 -0.794
4999996.81 -0.638
4999997.23 -0.554
4999996 -0.8
4999994.79 -1.042
4999997.23 -0.554
4999995.99 -0.802
4999995.99 -0.802
4999993.95 -1.21
4999997.16 -0.568
4999994.73 -1.054


Do you know about a cheap TXCO with little jitter?

« Last Edit: April 22, 2020, 04:06:17 pm by Picuino »
 

Offline KK6IL

  • Regular Contributor
  • *
  • Posts: 56
  • Country: us
Re: Frequency meter with 0.1ppm resolution
« Reply #31 on: April 23, 2020, 04:01:04 am »
I'm looking for a source oscillator cheap, but more precise than a simple crystal.
I have found this board in ebay:
https://www.ebay.com/itm/High-Accuracy-RF-Frequency-Counter-Meter-1-500-MHz-Tester-Module-For-ham-Radio/313035221538?hash=item48e25a6a22:g:Yy0AAOSwx9pedJG~

It uses an VC-TXCO in a 5032 package. It frequency stability is ± 2.5 ppm and low cost because all the PCB cost only $15.
I don't have good experience with TCXO. On one occasion I bought one TCXO (cost $2.80) that maintained a stability of 2.5ppm but with a lot of jitter.

Do you know about a cheap TXCO with little jitter?

You need to be looking at sellers that list a part number you can see the manufacturer data sheet, but I didn't see any cycle to cycle jitter specs on data sheets I checked, just phase noise at various offset freqs.

This sounds like a question for a time nut. Try asking over on the time nuts list at <http://www.leapsecond.com/time-nuts.htm>
 

Offline mino-fm

  • Regular Contributor
  • *
  • Posts: 147
  • Country: de
Re: Frequency meter with 0.1ppm resolution
« Reply #32 on: April 23, 2020, 07:09:26 am »
Example of measurements of my TXCO every second with jitter (ECS-TXO-5032-250-TR):

Your table does not show jitter of TCXO. What you can see are issues with signal processing, synchronisation or math functions calculating the frequency.

Try to fit it first - TCXO isn't your problem. I like to use this one https://www.digikey.de/product-detail/de/taitien/TXETALSANF-10-000000/1664-1262-1-ND/6126575, where you can see no jitter even at 10 digits/s.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #33 on: April 23, 2020, 11:31:08 am »
The measurements are well done and the instrument, although homemade, is checked with an OCXO and shows no problems.
I am thinking that the problem may be the LDO power supply, which has capacitors that cause the power to oscillate.
I hope the problem is with the power supply so I can use this TCXO.
Regards.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14716
  • Country: de
Re: Frequency meter with 0.1ppm resolution
« Reply #34 on: April 23, 2020, 11:57:22 am »
There can be a problem with different clocks (µC clock, reference clock and external DUT) hat are close to a simple ratio. They can start to synchronize via tiny coupling, e.g. through the supply and this can cause an extra frequency modulation. So it is important to really isolate the clocks from each other.

The errors in the table are really quite large up to the point that a rare software problem can happen. One such case could be coincidence of 2 interrupts that is not handled right. This is at least a trap with some µCs. Especially the crystal directly at the µC can be effected by other signals. I have see an effect from the ADC clock and the UART that can effect the clock - not much (e.g. ns phase shifts), but measurable.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #35 on: April 23, 2020, 01:37:44 pm »
The power supply is correct.
The problem is now very simple. I was trying to measure 25MHz with the frequency counter, that only accepts 15MHz maximum.
I'm going to make a frequency divider and measure again.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #36 on: April 23, 2020, 02:16:28 pm »
New measurement of TCXO. The main frequency (25MHz) is prescaled with a 1/4 divisor before measure.

DUT = TCXO of 25MHz / 4

Frequency counter main oscilator = OCXO calibrated.

Code: [Select]
6249999.3
6249999.4
6249999.3
6249999.3
6249999.3
6249999.3
6249999.3
6249999.3
6249999.3
6249999.3
6249999.2
6249999.3
6249999.3
6249999.2
6249999.3
6249999.3
6249999.2
6249999.4
6249999.2
6249999.3
6249999.2
6249999.3
6249999.2
6249999.2
6249999.3
6249999.2
6249999.2
6249999.3
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.1
6249999.2
6249999.2
6249999.1
6249999.1
6249999.2
6249999.2
6249999.1
6249999.2
6249999.1
6249999.2
6249999.1
6249999.1
6249999.1
6249999.2
6249999.2
6249999.1
6249999.1
6249999.1
6249999.2
6249999.1
6249999.1
6249999.2
6249999.1
6249999.1
6249999.2
6249999.2
6249999.1
6249999.1
6249999.1
6249999.1
6249999.1
6249999.1
6249999.1
6249999.1
6249999.2
6249999.0
6249999.1
6249999.2
6249999.2
6249999.1
6249999.3
6249999.2
6249999.3
6249999.3
6249999.3
6249999.3
6249999.3
6249998.6
6249999.3
6249999.2
6249999.3
6249999.2
6249999.2
6249999.3
6249999.3
6249999.2
6249999.2
6249999.2
6249999.3
6249999.2
6249999.2
6249999.2
6249999.1
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.1
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.2
6249999.1
6249999.2
6249999.2
6249999.1
6249999.1

The jitter in the last digit came from the measure instrument. The TCXO works properly with only 0.1ppm of error.

 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #37 on: April 23, 2020, 03:42:29 pm »
In the end I have decided to use a TCXO instead of a simple crystal. It can take better advantage of the capabilities of the frequency counter.
I will also remove NTC temperature compensation of frequency from the program, which couldn't be very accurate and gives me more than one headache.

Now the problem is how to connect a TCXO working at 3.3V with a PIC working at 5V.
Direct conection works but, I don't know if the margins of voltaje are enought robust. I will need to do tests.
Other conection could be with a series capacitor and a resistor of high impedance between CLKIN and CLKOUT.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #38 on: April 23, 2020, 04:30:51 pm »
I have connected the 25 MHz clock to the PIC16F18446 and by mistake I have activated the PLL x4 in the settings.
The result is that the PIC has been put to work at 100MHz. This PIC is only 32MHz ready, but withstands 100 MHz overclocking!!

I didn't know what was going on with the UART, which was sending the signals too fast.
Until I've connected the oscilloscope with a short code to turn a pin on and off.

 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14716
  • Country: de
Re: Frequency meter with 0.1ppm resolution
« Reply #39 on: April 23, 2020, 06:07:28 pm »
With too high an input clock the PLL may not get the indented factor. So it may run at only x 2 or even x 1 mode.
There is still quite some room for overclocking with those not so high end µCs. They often have quite some reserves, as they don't want to spend hours testing a $1 µC but prefer to be conservative on the specs.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #40 on: April 23, 2020, 06:25:41 pm »
Yes, they are a very robust uC. Better for all.

I have tested the clock input.

In "External Crystal" mode the oscillator input of the PIC is not very robust. It need near 3.3Vpp as minimum voltaje at CLKIN. The input does not have any polarization. It works but is no very robust.

In "HS" mode (Crystal Oscillator) the CLKIN accepts a signal as low as 1Vpp coupled with a capacitor. The CLKIN input has a impedance connected to 2.5V so it gives the polarization needed.

The final schematic is a simple capacitor:

 [  TCXO @ 3.3V  ]--------||-------[ CLKIN of PIC @ 5V  working as HS oscillator]

Regards
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #41 on: April 24, 2020, 06:56:37 am »
The power supply is correct.
The problem is now very simple. I was trying to measure 25MHz with the frequency counter, that only accepts 15MHz maximum.
I'm going to make a frequency divider and measure again.

I'm going to program an overrange detector in order to prevent this problem again.
« Last Edit: April 24, 2020, 07:38:55 am by Picuino »
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #42 on: April 24, 2020, 11:08:08 am »
Ok automatic overrange detection and improved prescaler routine. All programmed.

Today I'm trying to use Arduino like an USB-Serial interface. Works fine.
At last I'm going to design my frequency counter like an Arduino Shield without LCD and with connector for external LCD.
Do you think it might be a good idea?
 

Offline kawal

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: us
Re: Frequency meter with 0.1ppm resolution
« Reply #43 on: April 24, 2020, 01:24:11 pm »
What are you using for input stage ? And what protection .  You probably want some amplification and protection  but I didnt notice any in the schematic.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #44 on: April 24, 2020, 01:49:50 pm »
Thank you for the comment kawal.
You are right, I am directly using the input of the microcontroller. Do you have any proposal for a previous stage?
 

Offline kawal

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: us
Re: Frequency meter with 0.1ppm resolution
« Reply #45 on: April 24, 2020, 01:55:31 pm »
I would look at some commercial counters and see what they implement. At least a single stage 1 transistor gain stage feeding a Schmidt trigger input gate.  Resistor/ diod protection on input.
 

Offline PicuinoTopic starter

  • Super Contributor
  • ***
  • Posts: 1032
  • Country: es
    • Picuino web
Re: Frequency meter with 0.1ppm resolution
« Reply #46 on: April 24, 2020, 02:07:11 pm »
« Last Edit: April 24, 2020, 03:07:22 pm by Picuino »
 

Offline kawal

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: us
Re: Frequency meter with 0.1ppm resolution
« Reply #47 on: April 24, 2020, 02:51:57 pm »
Perfect , Diod protection on input  (limits voltage to input stage to +/-0.6V,  Amplifier with good gain , Schmidt gates to shape signal and divide by 2 circuit via D type counter.2n5485 is Jfet  not Mosfet.
« Last Edit: April 24, 2020, 03:11:39 pm by kawal »
 

Offline kawal

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: us
Re: Frequency meter with 0.1ppm resolution
« Reply #48 on: April 24, 2020, 03:03:26 pm »
Here is an Hp 5381A input stage
And Keithley 775A
« Last Edit: April 24, 2020, 03:07:46 pm by kawal »
 

Offline KK6IL

  • Regular Contributor
  • *
  • Posts: 56
  • Country: us
Re: Frequency meter with 0.1ppm resolution
« Reply #49 on: April 25, 2020, 03:12:54 am »
To amplify and limit low level RF signals in the past, I've used cascaded stages of an MC10116, now MC10216. Use a JFET source follower, followed by 2 or 3 stages of MC10216 and a comparator. Optional MC12080 as a HF/VHF prescaler.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf