PDA

View Full Version : analyzing clock jitter

darreno
03-15-2012, 04:00 AM
Anyone know of way to determine how much cycle to cycle jitter a clock has without having a spectrum analyzer?
The clock under test is up to 4MHz. I'm thinknig a propeller counter could only be used to find really large instabilities. Will a 20ppm crystal keep a propeller's clock accuracy near 20 ppm?

Mark_T
03-15-2012, 05:24 PM
Unless you use prop counter frequencies that are a divisor of 2^32 you get jitter from the counter modules... Quartz crystals produce very low jitter. By using waitpeq and waitpne in PASM you can time external signals to 12.5ns accuracy, so it depends on what amount of jitter you care about. Jitter is called "phase-noise" in the analog (RF) domain and 12.5ns of jitter is a show-stopper for RF signal processing.

darreno
03-15-2012, 08:48 PM
I was planning on measuring the jitter of a beat oscillation using one of the counters. From what I understand, if you can generate a stable frequency close to the signal being tested the beat between the two magnifies the jitter. So if I am able to use a 10MHz clock generated from an 80Mhz propeller to mix against a 980Khz clock the beat frequency should be 20Khz. The jitter should be amplified by 500x, which is what I hope to measure.

This is all theory, which I may be not fully understanding.

A question about the WAITPEQ, does it start the next instruction on the next clock cycle or after 6 cycles. I don't understand if the 6 cycle time for the instruction includes any latency after the condition is met.

Bean
03-16-2012, 03:25 AM
darreno,
I'm assuming you meant to mix 1MHz with 980KHz ???

One way is as you describe. Mix (xor) the two frequencies the result will be the sum and the difference. Then filter off the sum (low pass filter). That is how we did it in this video http://www.youtube.com/watch?v=fkYL7fluv5E

If I was doing it again, I would try sampling the 980KHz at 1MHz (1 million samples per second). This should be possible with PASM. The sampled pin should change state at 20KHz. You would count how many samples are high, then how many samples are low. The change in high or low counts will be the jitter.

If you want to try this method I could help you with the code. Let me know in this thread.

Bean

Phil Pilgrim (PhiPi)
03-16-2012, 03:47 AM
Another way to analyze jitter is to use the jittery clock to drive a PLL that has a long time constant. Then look at the output of the phase comparator before it hits the low-pass filter.

-Phil

jmg
03-16-2012, 08:50 AM
I was planning on measuring the jitter of a beat oscillation using one of the counters. From what I understand, if you can generate a stable frequency close to the signal being tested the beat between the two magnifies the jitter. So if I am able to use a 10MHz clock generated from an 80Mhz propeller to mix against a 980Khz clock the beat frequency should be 20Khz. The jitter should be amplified by 500x, which is what I hope to measure.

This is all theory, which I may be not fully understanding.

A question about the WAITPEQ, does it start the next instruction on the next clock cycle or after 6 cycles. I don't understand if the 6 cycle time for the instruction includes any latency after the condition is met.

IIRC WAITPEQ takes 6 cycles to 'get going' but thereafter it will sync to 1 clock, not the usual 4.

What time frame jitter do you want ? Do you mean measure the ppm error, or do you expect more jitter on this.4MHz ?

Generating Fsys/2^N will avoid any NCO rounding jitter, but it will have PLL jitter.
You could mix this down to an Audio range, and then use a Sound Card to get the spectrum which will give more info about the jitter.

darreno
03-16-2012, 05:26 PM
Thanks for all the ideas. Phil, can you recommend a PLL or two for my next parts order? a 4046?

This all came about when I started playing with a Si5351 clock generator. It's a fractional N clock that is very cheap but advertises a high max jitter (100ps). The datasheet doesn't say much about how to calculate the jitter given a choice of divisors so I though I'd learn how to measure it myself. I found out that jitter analysis tools even for a moderate clock rate can be expensive.

I think I may try a few different methods so I can compare them.

Phil Pilgrim (PhiPi)
03-16-2012, 05:36 PM
100 ps? Oh. I doubt that a 4046 (or any phase comparators that I'm familiar with) could switch that fast. And that may well be under the switching-time uncertainty of most logic chips. 'Probably explains why professional jitter analyzers are so expensive.

-Phil

darreno
03-16-2012, 07:35 PM
I was hoping to measure indirectly using jitter expansion which by the equations would be in the double digit ns range.

This may be an entire waste of time other than a good learning experience.

Phil Pilgrim (PhiPi)
03-16-2012, 09:26 PM
Take a look at this thread:

'Different app, but similar issues and a solution like what you're proposing.

-Phil

jmg
03-17-2012, 01:12 AM
Thanks for all the ideas. Phil, can you recommend a PLL or two for my next parts order? a 4046?

This all came about when I started playing with a Si5351 clock generator. It's a fractional N clock that is very cheap but advertises a high max jitter (100ps). The datasheet doesn't say much about how to calculate the jitter given a choice of divisors so I though I'd learn how to measure it myself. I found out that jitter analysis tools even for a moderate clock rate can be expensive.

I think I may try a few different methods so I can compare them.

Look at the report file for the Si5351, and you can 'work backwards'
It has a choice of pre-PLL lock, and post PLL - the Post PLL works like a NCO, so does a fractional divide from the VCO, and that will jitter at the VCO frequency.
They do mention the VCO somewhere, IIRC just under 2GHz, so peak jitter can be derived from that.
If you avoid the post-fractional, then the jitter will be much less.

If you want to test this more, the best way is likely to use TWO Si5351, and get the reports and then use the beat system then to check jitter.

darreno
03-17-2012, 04:53 AM
Thanks for the thread link on the rangefinder. It was very interesting to follow the development. "The laser module is the quickest and easiest module to test. It either works or blows up" :o

jmg, I'm not sure I understand what you mean by the report files for the 5351. Here's what the summary output of the "clock builder" application.

PLL A
Input Frequency (MHz) = 25.000000000
VCO Frequency (MHz) = 800.000000000
Feedback Divider = 32
SSC disabled

PLL B
Input Frequency (MHz) = 25.000000000
VCO Frequency (MHz) = 656.640000000
Feedback Divider = 26 166/625

Output Clocks
Channel 0
Output Frequency (MHz) = 0.100000000
Multisynth Divider = 250
R Divider = 32
PLL source = PLLA
Initial phase offset (ns) = 0.000
Inverted = No
Drive Strength (mA) = 8
Disable State = Low
Channel 1
Output Frequency (MHz) = 0.090000000
Multisynth Divider = 228
R Divider = 32
PLL source = PLLB
Initial phase offset (ns) = 0.000
Inverted = No
Drive Strength (mA) = 8
Disable State = Low

darreno
03-17-2012, 05:41 PM
I just read Bean's thread about the cable length measurement and noticed something that could be related to this topic.

In one of the posts Bean said "The reading are pretty jittery".

I'm wondering now if that was just the result I'm looking for.

jmg
03-19-2012, 08:55 AM
jmg, I'm not sure I understand what you mean by the report files for the 5351. Here's what the summary output of the "clock builder" application.

Here are the relevent lines, with the rest deleted

PLL A
Input Frequency (MHz) = 25.000000000
VCO Frequency (MHz) = 800.000000000
Feedback Divider = 32
PLL B
Input Frequency (MHz) = 25.000000000
VCO Frequency (MHz) = 656.640000000
Feedback Divider = 26 166/625

Output Clocks
Channel 0
Output Frequency (MHz) = 0.100000000
Multisynth Divider = 250
R Divider = 32
Multisynth Divider = 228
R Divider = 32

Note Silabs also have an option to have fractional post PLL dividers, which I think SiLabs call Multisynth Divider & R Divider
- so the channel with no fractional numbers at all, would make a good beat choice for a channel chosen to have fractional
Feedback Divider, or fractional Multisynth Divider
- so you can then measure the effect of the 'closer average value' has on the peak jitter.

Even a LV4046 would be useful here, as the sub 1ns phase change will show up on the Phase Detector output, as a level change, at rates shown by the Egyptian fractions - and a Narrow Pulse PhaseDet will have more mV/ns gain, than the XOR PhaseDet.